Closed fdelavega closed 7 years ago
I think you have a little typo in your query, try this:
{
query: [{
AND: {
categoriesId: ['5'],
lifecycleStatus: ['launched']
}
}]
}
I put your case into the tests, just to be sure: https://github.com/fergiemcdowall/search-index/blob/master/test/node/general-tests/328-test.js (passing)
Hi,
I am obtaining the same result with that query:
{"query":[{"AND":[{"categoriesId":["5"],"lifecycleStatus":["launched"]}],"NOT":[null]}],"hits":[],"totalHits":0}
Indeed the method getDocumentFreqencies of the searcher class is giving the same results with both queries (I mean the one I was using before) one hit for the status and 0 for the category Id, which results in a 0 hits result.
The estrange think about this, is that is not something that fails in all the cases, the following query:
{"query":[{"AND":[{"categoriesId":["13"]},{"lifecycleStatus":["launched"]}]}
and
"query":[{"AND":[{"categoriesId":["13"],"lifecycleStatus":["launched"]}]
Work properly. Making different queries I have seen that the only ones that are not giving me results are those that have a categoryIid of a single character (In my case 1, 5 and 7)
Taking into account that you have included it in a test, I think that there should be something in the environment
I think the best way forward here is to create a reproducible test case that shows the broken behaviour, and then we can take it from there.
as a wokarround I have included a fixed string at the begining of the ids (now are cat:5), which this change it works properly
It sounds like you have uncovered a bug that needs to be fixed possibly relating to the way that numeric strings are handled. Will leave this open in case anybody else experiences a similar problem
I'm pretty sure that this is now fixed- but please reopen if it persists
Hi,
I am having some trouble making queries over list fields. In my use case, I have some offerings which can belong to different categories. Then it is possible to search all the offerings in a category both, including the id of the category or its name.
For example, creating the document with the following data, we have the fields categoriesId, and categoriesName:
If I execute queries like the following, It works perfectly:
. But with the following query, it returns 0 hits: **Edit**: If the provided id has 2 or more characters, it works ("categoriesId":["11", "15"])