lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Wettin <karl.wet...@gmail.com>
Subject Re: Multifield Search with OR and AND on different doc Fields
Date Fri, 04 Jul 2008 18:40:26 GMT
4 jul 2008 kl. 08.30 skrev RanjithStar:


>
> My requirement is to search on SEVEN Fields say F1,F2,F3,F4,F5,F6,F7  
> having
> F1,F2,F3,F4 on one doc index
> and F5,F6,F7 on a different doc index
>
>
> I need to perform a search with ((F1=9 AND F2=4) AND (F3=keyword OR
> F4=keyword)) OR (F5=9 AND F6=4 AND F7=keyword)
>
>
> For normal search I was doing like this:
> String[] sFields = { ID1, ID2, TITLE, CONTENT };
> String[] sQuery = { id1, id2, sKeyword, sKeyword };
> Occur[] flag = { BooleanClause.Occur.MUST, BooleanClause.Occur.MUST,
> BooleanClause.Occur.MUST, BooleanClause.Occur.MUST };
> 				
> Query oQuery = oMultiParser.parse(sQuery, sFields, flag, oAnalyzer) ;
> Hits hits = indexSearcher.search(oQuery);
>

Do you hav some sort of problem with executing the code above? What  
did you expect it to do and what was the results?


>
> How can I modify the above query in such a way that it has to search  
> on
> different doc Indexes?


I'm sorry, but I don't understand your question.

You want to know how to search in another directory than the one  
associated with your indexSearcher object?



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message