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 ma...@yahoo.com on 2011/02/14 19:16:45 UTC

Multi Index Search Query

Hi,

I have two index files. I am searching id1 from Index A and id2 from Index B.
By using id1 (Index A) results , I am searching id2 from Index B. I stored these two index files in local file system.
I am using filter as a result of Index A.
IndexSearcher.search(Query,filter,10000);

I am running queries individually. Is there any possibility that I can combine these two queries into single query. Can I use Multi index search in this case ?

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


Re: Multi Index Search Query

Posted by Erick Erickson <er...@gmail.com>.
This is usually something you should not do. Is there any possibility you can
combine these indexes into one? Maybe sharded? Because this approach
is almost guaranteed to scale poorly.

This smells like an XY problem, perhaps you can back up and explain
what the higher-level problem you're trying to solve is...

See: http://people.apache.org/~hossman/#xyproblem

Best
Erick

On Mon, Feb 14, 2011 at 1:16 PM,  <ma...@yahoo.com> wrote:
> Hi,
>
> I have two index files. I am searching id1 from Index A and id2 from Index B.
> By using id1 (Index A) results , I am searching id2 from Index B. I stored these two index files in local file system.
> I am using filter as a result of Index A.
> IndexSearcher.search(Query,filter,10000);
>
> I am running queries individually. Is there any possibility that I can combine these two queries into single query. Can I use Multi index search in this case ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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


Re: Multi Index Search Query

Posted by Anshum <an...@gmail.com>.
If you actually intend at getting the intersection of 2 results from a
'union' of 2 indexes, you could use the filter and query approach. You could
use a multi searcher or a parallel multi searcher to perform the search in
this case.

--
Anshum Gupta
http://ai-cafe.blogspot.com


On Mon, Feb 14, 2011 at 11:46 PM, <ma...@yahoo.com> wrote:

> Hi,
>
> I have two index files. I am searching id1 from Index A and id2 from Index
> B.
> By using id1 (Index A) results , I am searching id2 from Index B. I stored
> these two index files in local file system.
> I am using filter as a result of Index A.
> IndexSearcher.search(Query,filter,10000);
>
> I am running queries individually. Is there any possibility that I can
> combine these two queries into single query. Can I use Multi index search in
> this case ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Multi Index Search Query

Posted by NhungLe <le...@yahoo.com>.
Hi all,

I have the same problem with Madhu, that i want to search over multi indexes
and over different fields.
Example: my search text: "lucene multi indexes",
 i want to search in index A (field: content1) and B (field: content2),
and the each result must contains "lucene multi indexes".
 
I tried to use MultiSearcher but I found that MultiSearcher returns the "OR"
results not "AND" 

Dose any one know how lucene can do it? or suggest me another way to do it?

Thanks,



--
View this message in context: http://lucene.472066.n3.nabble.com/Multi-Index-Search-Query-tp2494517p3025613.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.

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


Re: Multi Index Search Query

Posted by findbestopensource <fi...@gmail.com>.
I don't think so, you could combine the queries. You are first searching
Index A and the results are given as input to Index B. You cannot combine
the queries and you cannot use multi searcher or parallel multi searcher.
You need to search two indexes independently and sequentially.

Regards
Aditya
www.findbestopensource.com



On Mon, Feb 14, 2011 at 11:46 PM, <ma...@yahoo.com> wrote:

> Hi,
>
> I have two index files. I am searching id1 from Index A and id2 from Index
> B.
> By using id1 (Index A) results , I am searching id2 from Index B. I stored
> these two index files in local file system.
> I am using filter as a result of Index A.
> IndexSearcher.search(Query,filter,10000);
>
> I am running queries individually. Is there any possibility that I can
> combine these two queries into single query. Can I use Multi index search in
> this case ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>