0

I have a query that is not working.

I have two catalogs with the same fields and I am filtering by two of them, the field COUNTRY and the field CATEGORY, I just want the results where COUNTRY is equal to "ar" and CATEGORY start with "/Life And Style" OR start with "/vidayestilo"

Example: http://dominio.com:8080/solr/collation1/select?q=casa&shards=dominio.com:8080/solr/collation1,dominio.com:8080/solr/collation2&fq=COUNTRY:ar&fq=CATEGORY:(\/Life Y Style* OR \/vidayestilo*)

The above request returns no results.

If I change the filters: &fq=COUNTRY:ar&fq=CATEGORY:"\/Life And Style"*. Returns 6065 results. Only return results if I use quotes "\/Life And Style"*

If I change the filters: &fq=COUNTRY:ar&fq=CATEGORY:\/vidayestilo* Returns 1451 results. No need to use quotes \/vidayestilo*

Conclusion 1: I have to use quotes when there are spaces, so I based this theory i did the following request:

http://dominio.com:8080/solr/collation1/select?q=casa&shards=dominio.com:8080/solr/collation1,dominio.com:8080/solr/collation2&fq=COUNTRY:ar&fq=CATEGORY:("\/Life Y Style"* OR \/vidayestilo*)

It does not work because it returns 6065, only returns results for "\/Life And Style"*. Even if I add quotes to "\/vidayestilo"*, I have the same result.

And when I put in the first place "/vidayestilo"*: &fq=CATEGORY:("\/vidayestilo"* OR "\/Life And Style"*) returns 1451 results.

The correct is return 7516 Results (1451 + 6065), I dont know if this is happening by the spaces between Life Y Style because in this case I have to use quotation marks but it does not work when I use it in parentheses with OR.

I appreciate any help in this.

SweetEmerald2022
  • 47
  • 2
  • 2
  • 4

1 Answers1

0

I found this interesting post that helped me solve my problem ;) Solr wildcard query with whitespace

Community
  • 1
  • 1
SweetEmerald2022
  • 47
  • 2
  • 2
  • 4