0

I have issues using SOLR to search. My schema is defined as following:

    <field name="_root_" type="string" indexed="true" stored="false"/>
    <field name="_text_" type="text_general" multiValued="true" indexed="true" stored="true"/>
    <field name="_version_" type="long" indexed="true" stored="true"/>
    <field name="deleted" type="booleans" indexed="true" stored="true"/>
    <field name="description" type="strings" indexed="true" stored="true"/>
    <field name="favorites_count" type="tlongs"/>
    <field name="id" type="string" multiValued="false" indexed="true" required="true" stored="true"/>
    <field name="image" type="strings"/>
    <field name="ingredients" type="strings" multiValued="true" indexed="true" stored="true"/>
    <field name="level" type="tlongs"/>
    <field name="portions" type="tlongs" indexed="true" required="true" stored="true"/>
    <field name="preparation" type="strings"/>
    <field name="rating" type="tdoubles"/>
    <field name="ratings_count" type="tlongs"/>
    <field name="subject" type="strings" indexed="true" required="true" stored="true"/>
    <field name="visible" type="booleans" indexed="true" stored="true"/>

The issue is when I try to perform searching on the "ingredients" field.

Main query:

q=(subject:"phrase search input" OR description:"phrase search input") AND ingredients:("some ingredients phrase")

or ingredients:searchWord

The query without the ingredients parameter works just fine, with correct results output.

However, when it comes to filter on ingredients, no matter I am using fq or directly in the query string, I am getting wrong or no results at all.

The ingredients field has data as following:

ingredients:[ ingredient 1, ingredient 2, ingredient 3 phrase ]

The other issue is when the ingredient has "(" or ")" characters and I am searching such a phrase -- can't match.

SOLR version: 5.3

Does anybody can help me on this?

Thank you!

1 Answers1

0

It's hard to determine the exact cause without seeing the data and getting more information. However you can follow the following steps to troubleshoot the issue further yourself.

  1. Use the Solr Admin Analyzer to see how the data gets stored in the ingredients field and how it gets queries.
  2. Verify that you are loading the data into the ingredients field correctly. Make sure that each value you are sending is actually stored as an individual token.
  3. Keep in mind that you are not tokenizing the field. This may impact searching.
  4. Add a "debug=true" parameter to your query; you will get how Solr "sees" the query
Andrea
  • 2,714
  • 3
  • 27
  • 38
nick_v1
  • 1,654
  • 1
  • 18
  • 29