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 xpow <sw...@gmail.com> on 2013/03/15 10:01:17 UTC
Solr 3.6.1 and facet query regular expression
Hi, I have a question regarding how to facet query a particular field using a
regular expression ... I have a data like below:
{
"responseHeader":{
"status":0,
"QTime":10,
"params":{
"hl.fragsize":"500",
"facet":"true",
"sort":"score desc",
"indent":"on",
"facet.limit":"-1",
"hl.fl":"exactText",
"wt":"json",
"hl":"true",
"omitNorms":"true",
"rows":"3",
"fl":"title,id,mimetype",
"start":"0",
"hl.maxAlternateFieldLength":"500",
"q":"exactText:(*:*)",
"hl.alternateField":"exactText",
"facet.field":["mimetype",
"date"]}},
"response":{"numFound":3,"start":0,"docs":[
{
"mimetype":"application/xhtml+xml",
"title":"title 1",
"id":"http://www.abbc.go.id/1"},
{
"mimetype":"application/xhtml+xml",
"title":"title 2",
"id":"http://www.abbc.go.id/2"},
{
"id":"http://www.defg.go.id/3",
"title":"title 3",
"mimetype":"application/xhtml+xml"}]
},
"facet_counts":{
"facet_queries":{},
"facet_fields":{
"mimetype":[
"application/pdf",5,
"application/xhtml+xml",48,
"image/jpeg",7,
"text/html",15],
"date":[
"2011-07-13",1,
"2012-11-09",1,
"2012-11-12",1,
"2013-02-04",2,
"2013-03-04",1,
"2013-03-05",3,
"2013-03-11",3,
"2013-03-15",63]},
"facet_dates":{},
"facet_ranges":{}},
"highlighting":{
"http://www.abbc.go.id/1":{
"exactText":["content 1"]},
"http://www.abbc.go.id/2":{
"exactText":["content 2"]},
"http://www.defg.go.id/3":{
"exactText":["content 3"]}}}
My end goal would be to query based on content of exactText but within a
subset of a id field, for example:
- the keyword is "content"
- the regular expression that is applied to id is "http://www.abbc.go.id/*"
- there will be 2 results:
==> 1) http://www.abbc.go.id/1
==> 2) http://www.abbc.go.id/2
- the query would be q=exactText:(content)&fq=id:"http://www.abbc.go.id/*"
So my question: is it possible to query this using solr 3.6.1??
Thanks
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-1-and-facet-query-regular-expression-tp4047628.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr 3.6.1 and facet query regular expression
Posted by Erick Erickson <er...@gmail.com>.
Have you just tried what you showed? It should work if I understand the
question. If it doesn't work, please show us the query in, the response
out, and what is NOT as you expect.
Best
Erick
On Sat, Mar 16, 2013 at 5:20 AM, xpow <sw...@gmail.com> wrote:
> please help ...
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-3-6-1-and-facet-query-regular-expression-tp4047628p4047947.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
Re: Solr 3.6.1 and facet query regular expression
Posted by xpow <sw...@gmail.com>.
please help ...
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-1-and-facet-query-regular-expression-tp4047628p4047947.html
Sent from the Solr - User mailing list archive at Nabble.com.