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 "cmd.ares" <cm...@gmail.com> on 2014/03/25 09:50:13 UTC
intersect query
my_index(one core):
id,dealer,productName,amount,region
1,A1,iphone4,400,east
2,A1,iphone4s,450,east
3,A2,iphone5s,550,east
......
4,A1,iphone4,400,west
5,A1,iphone4s,450,west
6,A3,iphone5s,550,west
......
-----I'd like to get which dealer sale the 'iphone' both in the 'east' and
'west'
pl/sql reference implementation:
1:
select dealer from my_index where region='east' and productName like
'%iphone%'
intersect
select dealer from my_index where region='west' and productName like
'%iphone%'
2:
select distinct dealer from my_index where region='east' and productName
like '%iphone%' and sales in (
select dealer from my_index where region='west' and productName like
'%iphone%'
)
solr reference implementation:
1.query parameters:
q=region:east AND productName:iphone
&fq={!join from=dealer to=dealer}(region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
2.query parameters:
q=region:east AND productName:iphone({!join from=dealer
to=dealer}region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
with the big index,the query is very slow.Is there any efficient way to
improve performance?
1.if must use solr join feature??if there are other approach??
2.if multicore shards can improve performance??
/***
as the wiki said:
In a DistributedSearch environment, you can not Join across cores on
multiple nodes.
If however you have a custom sharding approach, you could join across cores
on the same node.
***/
--
View this message in context: http://lucene.472066.n3.nabble.com/intersect-query-tp4126828.html
Sent from the Solr - User mailing list archive at Nabble.com.
RE: intersect query
Posted by Susheel Kumar <su...@thedigitalgroup.net>.
How big is you index? #documents, #size?
Thanks,
Susheel
-----Original Message-----
From: cmd.ares [mailto:cmd.ares@gmail.com]
Sent: Tuesday, March 25, 2014 4:50 AM
To: solr-user@lucene.apache.org
Subject: intersect query
my_index(one core):
id,dealer,productName,amount,region
1,A1,iphone4,400,east
2,A1,iphone4s,450,east
3,A2,iphone5s,550,east
......
4,A1,iphone4,400,west
5,A1,iphone4s,450,west
6,A3,iphone5s,550,west
......
-----I'd like to get which dealer sale the 'iphone' both in the 'east' and
'west'
pl/sql reference implementation:
1:
select dealer from my_index where region='east' and productName like
'%iphone%'
intersect
select dealer from my_index where region='west' and productName like
'%iphone%'
2:
select distinct dealer from my_index where region='east' and productName
like '%iphone%' and sales in (
select dealer from my_index where region='west' and productName like
'%iphone%'
)
solr reference implementation:
1.query parameters:
q=region:east AND productName:iphone
&fq={!join from=dealer to=dealer}(region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
2.query parameters:
q=region:east AND productName:iphone({!join from=dealer
to=dealer}region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
with the big index,the query is very slow.Is there any efficient way to
improve performance?
1.if must use solr join feature??if there are other approach??
2.if multicore shards can improve performance??
/***
as the wiki said:
In a DistributedSearch environment, you can not Join across cores on
multiple nodes.
If however you have a custom sharding approach, you could join across cores
on the same node.
***/
--
View this message in context: http://lucene.472066.n3.nabble.com/intersect-query-tp4126828.html
Sent from the Solr - User mailing list archive at Nabble.com.
This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion defamatory or deemed to be defamatory or any material which could be reasonably branded to be a species of plagiarism and other statements contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.
Re: intersect query
Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Ares,
How about using field collapsing? https://wiki.apache.org/solr/FieldCollapsing
&q=+region:(east OR west) +productName:iPhone
&group=true
&group.field=dealer
If the number of distinct groups is high, CollapsingQueryParser could be used too.
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-CollapsingQueryParser
Ahmet
On Tuesday, March 25, 2014 10:50 AM, cmd.ares <cm...@gmail.com> wrote:
my_index(one core):
id,dealer,productName,amount,region
1,A1,iphone4,400,east
2,A1,iphone4s,450,east
3,A2,iphone5s,550,east
......
4,A1,iphone4,400,west
5,A1,iphone4s,450,west
6,A3,iphone5s,550,west
......
-----I'd like to get which dealer sale the 'iphone' both in the 'east' and
'west'
pl/sql reference implementation:
1:
select dealer from my_index where region='east' and productName like
'%iphone%'
intersect
select dealer from my_index where region='west' and productName like
'%iphone%'
2:
select distinct dealer from my_index where region='east' and productName
like '%iphone%' and sales in (
select dealer from my_index where region='west' and productName like
'%iphone%'
)
solr reference implementation:
1.query parameters:
q=region:east AND productName:iphone
&fq={!join from=dealer to=dealer}(region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
2.query parameters:
q=region:east AND productName:iphone({!join from=dealer
to=dealer}region:west AND productName:iphone)
&facet=true&facet.filed=dealer&facet.mincount=1
with the big index,the query is very slow.Is there any efficient way to
improve performance?
1.if must use solr join feature??if there are other approach??
2.if multicore shards can improve performance??
/***
as the wiki said:
In a DistributedSearch environment, you can not Join across cores on
multiple nodes.
If however you have a custom sharding approach, you could join across cores
on the same node.
***/
--
View this message in context: http://lucene.472066.n3.nabble.com/intersect-query-tp4126828.html
Sent from the Solr - User mailing list archive at Nabble.com.