lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: How to search over all fields in a clean way?
Date Wed, 15 Aug 2007 11:01:01 GMT
copying all fields to a single searchable field is quite reasonable,  
and won't double your index size if you set the new field to be  
unstored.

	Erik


On Aug 15, 2007, at 5:38 AM, Ridwan Habbal wrote:

> Hello all,
>
> when we search over an index docs we use code such:
>
> Analyzer analyzer = new StandardAnalyzer();
> String defaultSearchField = "all";
> QueryParser parser = new QueryParser(defaultSearchField, analyzer);
> IndexSearcher indexSearcher = new IndexSearcher(this.indexDirectory);
> Hits hits = indexSearcher.search(parser.parse(query));
>
> The problem is when you want to search over ALL fields in each doc.  
> What's more is that the fields are created dynamically. In other  
> words, The number and identifiers of the fields of my docs vary  
> from each other. so it's irrational to type all fields names,  
> further more i don't know them.
> I thought of a primitive solution: copy all fields to one field,  
> however this doubles the index size, and it might conflict with  
> some fields names since the fields of docs are dynamic.
>
> could some one help me?
>
> Thanks in advance.
> Ridwan
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en- 
> US&form=QBRE


---------------------------------------------------------------------
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