2

There is a field say XYZ with value as either TRUE or FALSE. i am searching as following

+Contents:risk +XYZ:TRUE

is it legal to search like that? i tried but it showed me results with FALSE value too.

What was more amazing is that i searched by +XYZ:[TRUE TO TRUE] and it worked.

can some one tell me what exactly is my mistake?

2
  • 1
    Your query is correct. Since you have obfuscated the field name, I am not sure if the actual field name for XYZ is correct. Field names are case sensitive in Lucene. You may wish to verify that. Commented Sep 9, 2010 at 12:45
  • thank for hint; let me double check if its because of case sensitivity. Commented Sep 17, 2010 at 6:48

1 Answer 1

2

it's perfectly fine to search like that. Did you ensure that your analyzers are correct?

Sign up to request clarification or add additional context in comments.

2 Comments

I am using StandardAnalyzer. I had indexed with Lucene.NET v2.9 and searching with SOLR.NET. But before calling SOLR to search, i made a booleanQuery myself.
Following is the configuration in SOLR, Let me know if i am missing something in this; <fieldtype name="text" class="solr.TextField"> <analyzer> <tokenizer class="solr.StandardTokenizerFactory" luceneMatchVersion="LUCENE_29"/> <filter class="solr.StandardFilterFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldtype> To add to above, i used StandardAnalyzer as : analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(new string[] { "" });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.