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 Marc SCHNEIDER <ma...@gmail.com> on 2012/01/04 16:27:08 UTC

Problem with facet.fields

Hi,

I'm quite sure I'm missing something but I'm getting mad with this problem :

If I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
=> I have results for facet fields
If I put : q=*:*&facet=true&facet.field=lom.educational.context
=> I have results for facet fields

But if I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
&facet.field=lom.educational.context

I have only facet results for the first field. I tried to invert them and
got also only results for the first field. It is like the the second field
was ignored.

Furthermore I tried :
q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
=> it works although the 'foo' field doesn't exist
q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
=> gives me an error telling me the 'foo' field doesn't exist.

I'm running Solr 3.5

Any idea about this weird thing?

Thanks,
Marc.

Re: Problem with facet.fields

Posted by Chris Hostetter <ho...@fucit.org>.
: So multivalued URL params are not taken in account.
: I'm using Jetty and Solrj with EmbeddedSolrServer implementation.
: Trying it using the "normal" http version does work, so you're right
: it's a problem with the client library.
: 
: Any idea why it would refuse multivalued parameters?

i don't really understand what "Jetty and Solrj with EmbeddedSolrServer" 
means ... if you're running in EmbeddedSolrServer then i don't udnerstand 
how you are using Jetty.  that also doens't really explain what your 
client code looks like, and where you are are puttting those "URLs" if you 
are interacting with Solr via EmbeddedSolrServer.

underingstanding what mistake might existing the client layer w/o *seeing* 
the client code is really just taking a shot i nthe dark, but if i had to 
guess i would suppose that somwhere you are putting your request params 
into a simple java.util.Map and letting the keys overwrite one another.



-Hoss

Re: Problem with facet.fields

Posted by Marc SCHNEIDER <ma...@gmail.com>.
Hello,

Thanks a lot for your answers.

Sorry I typed it wrong, it was :
q=*:*&facet=true&facet.field=foo&facet.field=lom.classification.ddc.id
which caused an error.

That's said I added echoParms to the request and only got :
<str name="facet.field">lom.classification.ddc.id</str>

So multivalued URL params are not taken in account.
I'm using Jetty and Solrj with EmbeddedSolrServer implementation.
Trying it using the "normal" http version does work, so you're right
it's a problem with the client library.

Any idea why it would refuse multivalued parameters?

Marc.

On Wed, Jan 4, 2012 at 9:23 PM, Chris Hostetter
<ho...@fucit.org> wrote:
>
>
> : If I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
> : => I have results for facet fields
> : If I put : q=*:*&facet=true&facet.field=lom.educational.context
> : => I have results for facet fields
> :
> : But if I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
> : &facet.field=lom.educational.context
> :
> : I have only facet results for the first field. I tried to invert them and
> : got also only results for the first field. It is like the the second field
> : was ignored.
>
> How are you doing these queries?  Are you using some sort of client
> library via some langauge, or are you pasting those URL snippets into a
> browser?  what does the "responseHeader" section of the results look like
> if you add echoParams=all to the URL?  what servlet container are you using?
>
> My suspicion is that you are using some client library that doesn't
> understand multivalued URL params and is just putting them into a map, the
> responseHeader w/echoParams turned on will tell you exactly what Solr is
> getting.
>
> I just tried this using the example schema in Solr 3.5 and it worked
> fine...
>
> http://localhost:8983/solr/select?echoParams=all&q=*:*&facet=true&facet.field=lom.classification.ddc.id_s&facet.field=lom.educational.context_s
>
> : Furthermore I tried :
> : q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
> : => it works although the 'foo' field doesn't exist
> : q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
> : => gives me an error telling me the 'foo' field doesn't exist.
>
> i don't understand these last examples at all ... both of those lines are
> identical
>
>
> -Hoss

Re: Problem with facet.fields

Posted by Chris Hostetter <ho...@fucit.org>.
: If I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
: => I have results for facet fields
: If I put : q=*:*&facet=true&facet.field=lom.educational.context
: => I have results for facet fields
: 
: But if I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
: &facet.field=lom.educational.context
: 
: I have only facet results for the first field. I tried to invert them and
: got also only results for the first field. It is like the the second field
: was ignored.

How are you doing these queries?  Are you using some sort of client 
library via some langauge, or are you pasting those URL snippets into a 
browser?  what does the "responseHeader" section of the results look like 
if you add echoParams=all to the URL?  what servlet container are you using?

My suspicion is that you are using some client library that doesn't 
understand multivalued URL params and is just putting them into a map, the 
responseHeader w/echoParams turned on will tell you exactly what Solr is 
getting.

I just tried this using the example schema in Solr 3.5 and it worked 
fine...

http://localhost:8983/solr/select?echoParams=all&q=*:*&facet=true&facet.field=lom.classification.ddc.id_s&facet.field=lom.educational.context_s

: Furthermore I tried :
: q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
: => it works although the 'foo' field doesn't exist
: q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
: => gives me an error telling me the 'foo' field doesn't exist.

i don't understand these last examples at all ... both of those lines are 
identical


-Hoss

Re: Problem with facet.fields

Posted by "Sethi, Parampreet" <pa...@teamaol.com>.
Hi Marc,

It could be because of "." in the field name. Try doing url encoding of
"." and it should work.

"But if I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
&facet.field=lom.educational.context "


-param

On 1/4/12 10:27 AM, "Marc SCHNEIDER" <ma...@gmail.com> wrote:

>Hi,
>
>I'm quite sure I'm missing something but I'm getting mad with this
>problem :
>
>If I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
>=> I have results for facet fields
>If I put : q=*:*&facet=true&facet.field=lom.educational.context
>=> I have results for facet fields
>
>But if I put : q=*:*&facet=true&facet.field=lom.classification.ddc.id
>&facet.field=lom.educational.context
>
>I have only facet results for the first field. I tried to invert them and
>got also only results for the first field. It is like the the second field
>was ignored.
>
>Furthermore I tried :
>q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
>=> it works although the 'foo' field doesn't exist
>q=*:*&facet=true&facet.field=lom.classification.ddc.id&facet.field=foo
>=> gives me an error telling me the 'foo' field doesn't exist.
>
>I'm running Solr 3.5
>
>Any idea about this weird thing?
>
>Thanks,
>Marc.