Hi,

Not sure if this is what you want, but would this do what you need?

fq={!tag=p1}publisher_name:publisher1&fq={!tag=p2}publisher_name:publisher2&q=abstract:philosophy&facet=true&facet.mincount=1&facet.field={!ex=p1 key=p2_book_title}book_title&facet.field={!ex=p2 key=p1_book_title}book_title

or seperated by newlines instead of & for readability:

fq={!tag=p1}publisher_name:publisher1
fq={!tag=p2}publisher_name:publisher2
q=abstract:philosophy
facet=true
facet.mincount=1
facet.field={!ex=p1 key=p2_book_title}book_title
facet.field={!ex=p2 key=p1_book_title}book_title

Of course, this uses an 1.4 feature (tagging and excluding)

Regards,

gwk

Jeffrey Tiong wrote:
Hi,

I have a schema that has the following fields,

publisher_name
book_title
year
abstract

Currently if I do a facet count when I have a query "q=abstract:philosophy
AND publisher_name:publisher1" , it can give me results like below,

<str name="q">abstract:philosophy AND publisher_name:publisher1</str>
<lst name="book_title">
     <int name="book1"> 70 </int>
     <int name="book2"> 60 </int>
     <int name="book3"> 20 </int>
</lst>
<lst name="year">
     <int name="1990"> 78 </int>
     <int name="1991"> 62 </int>
     <int name="1992"> 19 </int>
</lst>


Likewise for "q=abstract:philosophy AND publisher_name:publisher2" -

<str name="q">abstract:philosophy AND publisher_name:publisher2</str>
<lst name="book_title">
     <int name="book1"> 3 </int>
     <int name="book2"> 1 </int>
     <int name="book3"> 1 </int>
</lst>
<lst name="year">
     <int name="1989"> 3 </int>
     <int name="1990"> 1 </int>
     <int name="1992"> 1 </int>
</lst>


However I have to do the query separately and get the facet count for each
of them separately. Is there a way for me to combine all these into one
query and get the facet count for each of them at one query?  because
sometimes it may go up to 20 queries in order to get all the separate
counts.


Thanks!

Jef


Reply via email to