You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Lukas Zapletal <lz...@root.cz> on 2003/01/13 10:05:53 UTC
Multiple fields
Hello all!
Q1:
Is there any easy way to search more than one field?
I mean I have 'content', 'headlines' and 'title' fields.
I need to search titles with best score, headlines with better score and
content with normal score.
I want to avoid these HitCollectors... If there is no easy way can you
write me
how this can be done with HitCollectors? My code:
query = QueryParser.parse(str, "content", analyzer);
Hits hits = searcher.search(query);
Q2:
What score numbers to use with these fields?
I mean 1.0001 for title or something else?
--
Lukas Zapletal
http://www.tanecni-olomouc.cz/lzap
lzap@root.cz
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Alphabetical order
Posted by Peter Carlson <ca...@bookandhammer.com>.
There is a class called SearchBean in the contributions area which
provides for a generic sorting of results.
It is currently setup for sorting by any String field.
I hope that helps.
--Peter
On Monday, January 13, 2003, at 10:28 AM, Alain Lauzon wrote:
> Is it possible to display results in alphabetical order between
> documents of same relevancy ?
>
> Alain Lauzon
> alauzon@libertefinanciere.com
>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Alphabetical order
Posted by Alain Lauzon <al...@libertefinanciere.com>.
Is it possible to display results in alphabetical order between documents
of same relevancy ?
Alain Lauzon
alauzon@libertefinanciere.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Is the searched string 'on' a special case ?
Posted by Alain Lauzon <al...@libertefinanciere.com>.
I have an index wtih many fields, and specially, one for company name and
one for state.
When I search for :
+company:"inc"~100
I get 114 results from 2 states, HI (Hawaii) and ON (Ontario).
If I search for :
+state:hi +company:"inc"~100
I get 7 results for Hawaii.
But when I search for:
+state:on +company:"inc"~100
I get no results at all for Ontario.
So what is going on ? I tried with many other states and all are working,
but not 'on'.
Is 'on' a special case ? Like on/off ?
Alain Lauzon
alauzon@libertefinanciere.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Multiple fields
Posted by Otis Gospodnetic <ot...@yahoo.com>.
A1. MultiFieldQueryParser if you want to use a parser, or BooleanQuery
A2. Keep in mind that shorter fields already get a scoring boost. Is
this for setting boost on fields? Any number should do, no?
Otis
--- Lukas Zapletal <lz...@root.cz> wrote:
> Hello all!
>
> Q1:
> Is there any easy way to search more than one field?
> I mean I have 'content', 'headlines' and 'title' fields.
> I need to search titles with best score, headlines with better score
> and
> content with normal score.
> I want to avoid these HitCollectors... If there is no easy way can
> you
> write me
> how this can be done with HitCollectors? My code:
>
> query = QueryParser.parse(str, "content", analyzer);
> Hits hits = searcher.search(query);
>
> Q2:
> What score numbers to use with these fields?
> I mean 1.0001 for title or something else?
>
>
> --
> Lukas Zapletal
> http://www.tanecni-olomouc.cz/lzap
> lzap@root.cz
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>