lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lu" <chris...@gmail.com>
Subject Re: Lucene DB indexing and searching Question (1.9.1)
Date Thu, 27 Apr 2006 15:54:54 GMT
You need to use MultiFieldQueryParser

http://lucene.apache.org/java/docs/api/org/apache/lucene/queryParser/MultiFieldQueryParser.html

Sincerely,
Chris Lu
---------
Full-text search on Any Databases/Applications
http://www.dbsight.net


On 4/27/06, Audrius Peseckis <audrius@ivs.lt> wrote:
> Hello,
>
> What I'm trying to do is to index database with lucene. Each row returned by SQL query
is represented as document, and document contains fields (values of columns). I'm adding those
fields to document by doing the following:
> Field fld = new Field("COLUMN_NAME", column.value());
>
> Now when I'm trying to search the index, I only get the values of the column text (default
field name).
> Searcher searcher = new IndexSearcher(DIR);
> QueryParser qp = new QueryParser("text", new StandardAnalyzer());
> Query query = qp.parse("a*");
>
> How to query a search engine, if I want to get results from all indexed fields, not only
default provided?
>
> Thanks in advance,
> Audrius
>

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