tags:

views:

26

answers:

1

I am using lucene.Net for searching in my application. I have to search in two fields so I am adding two term queries in a boolean query and the resulted boolean query is +(location:a* +(id:19))

I am using pagination to display results to the user. When I want to get next n records in my result set I am again exeuting the same search.

When executing search for the next time I dont want to prepare the query and I want o use the same query "+(location:a* +(id:19))" as is.

How do I use it, which query should I use..because al most all types query requires field name. But I have the query which is parsed and want to use as is.

Please let me know if some body has any idea.

A: 
  1. Use the Queryparser.Parse() method to parse the query string and get a Query object.
  2. Store the Query object for the next round.
  3. Use one of the Searcher.Search() methods with the stored Query.
Yuval F
Thanks for the reply.
lucene user