Can prefix filtering also be used on string arrays...
# community-help
g
Can prefix filtering also be used on string arrays?
k
Yup it works
g
It seems there is an issue when the string contains a "/"
I'm searching in ["alimentation/miel/miel-de-montagne"] this will works slugPath:[alimentation/miel/m*] but this wont slugPath:[alimentation/miel/*]
I'm on 27.1
k
I suspect we drop the / because it's not indexed. You have to add it to symbols_to_index
Use v29 -- you can configure it on a per field basis.
g
would it requires reindexing all documents after such a change?
k
Yes you can't do it with alter command.
You've to create new collection and then reindex.
g
Ok thanks a lot will give a try
Ok I confirm it works well with v29 + adding symbols_to_index: ['/']
About the breaking change in v29 concerning found I'm not sure how to interpret this. šŸ¤” • `For
group_by
queries, the
found
value returned in the response is no longer an exact number. It's an • approximation of the number of groups found, and is guaranteed to be within 2% of the actual number of groups found. `
k
Yeah the count is an approximate now
The earlier approach was not scalable for larger datasets
g
Ok after deeper tests it is not working as expected. ["alimentation/autres-produits/miel/miel-de-foret"] slugPath:[alimentation/autres-produits/miel/miel-de-foret*] OK slugPath:[alimentation/autres-produits/miel*] OK slugPath:[alimentation/autres-produits/m*] OK slugPath:[alimentation/autres-produits/*] KO slugPath:[alimentation/autres-produits*] KO Here is my field config
Copy code
{
  "facet": true,
  "index": true,
  "infix": false,
  "locale": "",
  "name": "categories[].categories_id.slugPath",
  "optional": true,
  "sort": false,
  "stem": false,
  "stem_dictionary": "",
  "store": true,
  "symbols_to_index": [
    "/"
  ],
  "type": "string[]"
}
k
Can you please create a github issue with a small reproducible example in this format: https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b
f
The script in the issue wasn't working, so I've fixed some things in order for it to work (bad JSON in the collection schema, non-existent collection to index documents on). Apart from that, the document indexed is being found by the filter by clause. Could you explain which documents would not match the filter?
g
Thank you giving a look at my test case. After further investigation, I realized that the tests were performed against incorrectly indexed documents. I linked my final shell script testing multiple cases, all good. I have updated and closed the issue.
āœ… 1
šŸ‘ 1