views:

32

answers:

1

Hi,

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?

+1  A: 

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

Xodarap
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.
Umer
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[] { "" });
Umer