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 Rodrigo Rosenfeld Rosas <rr...@gmail.com> on 2013/10/08 14:37:28 UTC

Applying an "AND" search considering several document snippets as a single document

Hi there, this is my first message to this list :)

In our application we have a document split in several pages. When the 
user searches for words in a document we want to bring all documents 
containing all the words but we'd like to add a link to the specific 
page for each highlighting.

Currently, I could think of some solution like indexing both the full 
documents and the pages and do this using two steps (conceptually, as I 
haven't actually implemented this):

- perform an "AND" search across the full documents only and retrieve 
the document ids
- perform an "OR" search across the pages index only for those pages 
belonging to the previously returned document ids so that I could build 
the link to the specific returned pages.

But while the "AND" search is already a bit slow here, I'd like to avoid 
two Solr queries if possible, as I already need another RDBMS query as 
well and all of that sum up.

Is there any way I could tell Solr to consider all indexed documents 
with an specified attribute as a single document for an "AND" matching 
purpose?

Thanks in advance,
Rodrigo.