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 Niels Ott <ni...@drni.de> on 2008/10/22 15:14:30 UTC

Combining keyword queries with database-style queries

Hi everybody,

I need to query for documents not only for search terms but also for 
numeric values (or other general types). Let me try to explain with a 
hypothetical example.

Assuming there is a value for the number words in each document (or the 
number of person names, or whatever), I would want to formulate a query 
like "Give me documents containing 'jack johnson' AND with token_count > 
250".

I've been working with Lucene before and the keyword part is easy, but 
what would be a good solution to query for numbers etc.?

One first idea I had was storing the numbers (which are basically a 
HashMap<String,Double>) in the index in some way or the other. But it is 
not at all obvious for me how to query them then.

Another thing I could think of would be using a separate database of any 
type, but then how to bring those two together in a way that makes sense?

Any pointers to useful resources and any types of hints are welcome! :-)

Best,

   Niels


-- 
Niels Ott
Computational Linguist (B.A.)
http://www.drni.de/niels/

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Combining keyword queries with database-style queries

Posted by Niels Ott <no...@sfs.uni-tuebingen.de>.
Erick Erickson schrieb:
> Is this an inadvertent re-post or is there still something you're wondering
> about?

I originally posted with an address not subscribed to the list, causing 
the list server to silently swallow the message. Now the message 
apparently made it here with some delay, for whatever reason.

Sorry for the inconvenience.

    Niels

-- 
Niels Ott
Computational Linguist (B.A.)
http://www.drni.de/niels/

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Combining keyword queries with database-style queries

Posted by Erick Erickson <er...@gmail.com>.
Is this an inadvertent re-post or is there still something you're wondering
about?

Erick

On Wed, Oct 22, 2008 at 9:14 AM, Niels Ott <ni...@drni.de> wrote:

> Hi everybody,
>
> I need to query for documents not only for search terms but also for
> numeric values (or other general types). Let me try to explain with a
> hypothetical example.
>
> Assuming there is a value for the number words in each document (or the
> number of person names, or whatever), I would want to formulate a query like
> "Give me documents containing 'jack johnson' AND with token_count > 250".
>
> I've been working with Lucene before and the keyword part is easy, but what
> would be a good solution to query for numbers etc.?
>
> One first idea I had was storing the numbers (which are basically a
> HashMap<String,Double>) in the index in some way or the other. But it is not
> at all obvious for me how to query them then.
>
> Another thing I could think of would be using a separate database of any
> type, but then how to bring those two together in a way that makes sense?
>
> Any pointers to useful resources and any types of hints are welcome! :-)
>
> Best,
>
>  Niels
>
>
> --
> Niels Ott
> Computational Linguist (B.A.)
> http://www.drni.de/niels/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>