You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Avner Levy <av...@checkpoint.com> on 2014/01/18 07:01:51 UTC

Storing ranges on documents and searching all document with specific value included

I have millions of documents with the following fields:
name (string), start version (int), end version (int).



I need to query efficiently all records which answers the query:
Select all documents where version >= "start version" and version<="end version"

Running the above query took 50-100 ms while similar query by tagging each version took only 15 ms.
My question is how efficient can Solr handle such queries? (since it isn't classic FTS query)
Do I need to define something special in order to optimize performance?
Any alternate solutions will be welcomed.
The fields values / types can be changed if needed.


Re: Storing ranges on documents and searching all document with specific value included

Posted by Jack Krupansky <ja...@basetechnology.com>.
What does your actual query look like? Is it two range queries and an AND? 
Also, you have spaces in your field names, so that makes it more difficult 
to write queries since they need to be escaped.

-- Jack Krupansky

-----Original Message----- 
From: Avner Levy
Sent: Saturday, January 18, 2014 1:01 AM
To: 'solr-user@lucene.apache.org'
Subject: Storing ranges on documents and searching all document with 
specific value included

I have millions of documents with the following fields:
name (string), start version (int), end version (int).



I need to query efficiently all records which answers the query:
Select all documents where version >= "start version" and version<="end 
version"

Running the above query took 50-100 ms while similar query by tagging each 
version took only 15 ms.
My question is how efficient can Solr handle such queries? (since it isn't 
classic FTS query)
Do I need to define something special in order to optimize performance?
Any alternate solutions will be welcomed.
The fields values / types can be changed if needed.


Re: Storing ranges on documents and searching all document with specific value included

Posted by Erick Erickson <er...@gmail.com>.
Well, assuming that your start version and end versions are a limited set of
values, filter queries (fq clauses) would help you a lot here. Autowarming them
would cause them to be available the first time they were used...

Best,
Erick

On Sat, Jan 18, 2014 at 1:01 AM, Avner Levy <av...@checkpoint.com> wrote:
> I have millions of documents with the following fields:
> name (string), start version (int), end version (int).
>
>
>
> I need to query efficiently all records which answers the query:
> Select all documents where version >= "start version" and version<="end version"
>
> Running the above query took 50-100 ms while similar query by tagging each version took only 15 ms.
> My question is how efficient can Solr handle such queries? (since it isn't classic FTS query)
> Do I need to define something special in order to optimize performance?
> Any alternate solutions will be welcomed.
> The fields values / types can be changed if needed.
>