0

I am creating a booleanquery in Lucene.net in order to search multiple fields for multiple values.

Running the below constructed query (returns +CustomerId:5) will bring back results.

var booleanQuery = new BooleanQuery();
        Query query = new TermQuery(new Term("CustomerId", "5"));
        booleanQuery.Add(query, Occur.MUST);

Running this other query

var booleanQuery = new BooleanQuery();
        Query query = new TermQuery(new Term("CustomerId", "5"));
        booleanQuery.Add(query, Occur.MUST);
        Query query1 = new TermQuery(new Term("Make", "Subaru"));
        booleanQuery.Add(query1, Occur.MUST);

returns (+CustomerId:5 +Make:Subaru)brings back 0 results even though i can see from the first query that both criteria can be met. As far as i know this should work. Any help is appreciated.

Adamon
  • 484
  • 9
  • 21

1 Answers1

0

Just in case anyone else is having problems with their queries and feel like mine looked right. The search needed to be carried out using lower case for field value. Using standard analyzer this is how the data was indexed.

Adamon
  • 484
  • 9
  • 21