lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From digy digy <digyd...@gmail.com>
Subject Re: [Lucene.Net] search within a list of unique ID's
Date Fri, 27 May 2011 07:36:19 GMT
When term count in query increases, search time increases also. Therefore,
if possible, use precomputed BitSets and "AND" it with user's query. Another
costly operation is the fectching data from the index. Limiting the result
count to smaller numbers may help too.

DIGY

On Fri, May 27, 2011 at 10:18 AM, digy digy <digydigy@gmail.com> wrote:

> Creation of SimplefacetedSearch is slow. Therefore it should only be
> created  when a new reader is opened (or reopened).
> DIGY
>
>
> On Fri, May 27, 2011 at 10:02 AM, Marco Dissel <marco.dissel@gmail.com>wrote:
>
>> Our index contains documents with an unique ID (long number) corresponding
>> to a record in SQL database. I want to start a lucene search within a list
>> of ID's returned from a SQL resultset.
>>
>> IDataReader reader = cmd.Execute("select ID from ...")
>> long[] ids = GetID's(reader);
>> string search = Join(ids) /// results in (ID:1 OR ID:2 OR ID:3)
>> search += " AND (" + <searchstring entered by user> + ")";
>> IndexSearcher searcher = new IndexSearcher(_Reader);
>> Query query = new Lucene.Net.QueryParsers.QueryParser(,,,, search);
>> TopDocs docs = searcher.Search(query, 1000000);
>>
>> Is this the way to go?
>>
>> Thanks
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message