Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON Wildcard Notation #241

Open
jholmes001 opened this issue Sep 25, 2022 · 2 comments
Open

JSON Wildcard Notation #241

jholmes001 opened this issue Sep 25, 2022 · 2 comments
Labels

Comments

@jholmes001
Copy link

Hi!

Here's an example of a JSON document that's inserted into a store called 'search_index'.

"title" : "Group 1",
"soc" : [{
   "1234" : {
      "job_title" : "Computer Programmer",
      "job description" : "Computer science description"
   },
   "4567" : {
      "job_title" : "Computer Analyst",
      "job description" : "Computer analyst description"
   }
}]

I'm trying to setup a search fetch using the code below:

$search_fields = array( "title", "soc.*.job_title", "soc.*.job description" );
$relevance_params = array( "relevance" => "DESC" );
$sleekdb_data = $store->search( $search_fields, $input["slug"], $relevance_params );

I want "job_title" and "job description" fields (which are sub-fields of "SOC") to be used as fields to search for, using JSON notation as described in the documentation. However, the sub-fields are always different numbers so I'd like to use something like a wildcard notation. I'm not getting any results so it's obviously not working. Is there a way to include the two sub-fields, along with the "title" field?

@Timu57 Timu57 assigned Timu57 and unassigned Timu57 Sep 28, 2022
@Timu57 Timu57 added the feature label Sep 28, 2022
@Timu57
Copy link
Member

Timu57 commented Sep 28, 2022

Hi @jholmes001
Currently there is no* wildcard notation feature available.
We are looking forward to implement such a feature with the next major release.
For now you should think of another data structure to search through 😊

@s-vhs
Copy link

s-vhs commented Jan 4, 2023

I am really seeing forward to the next release since I need this feature as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants