Re: Solr Faceting doesn't return values.

2013-05-23 Thread Sandeep Mestry
*str name=msgorg.apache.solr.search.SyntaxError: Cannot parse
'*mm_state_code:(**TX)*': Encountered  : :  at line 1, column 14.
Was expecting one of:*

This suggests to me that you kept the df parameter in the query hence it
was forming mm_state_code:mm_state_code:(TX), can you try exactly they way
I gave you - i.e. without the df parameter?
Also, can you post schema.xml and /select handler config from
solrconfig.xml?


On 22 May 2013 18:36, samabhiK qed...@gmail.com wrote:

 When I use your query, I get :

 ?xml version=1.0 encoding=UTF-8?
 response

 lst name=responseHeader
   int name=status400/int
   int name=QTime12/int
   lst name=params
 str name=facettrue/str
 str name=dfmm_state_code/str
 str name=indenttrue/str
 str name=q*mm_state_code:(**TX)*/str
 str name=_1369244078714/str
 str name=debugall/str
 str name=facet.fieldsa_site_city/str
 str name=wtxml/str
   /lst
 /lst
 lst name=error
   str name=msgorg.apache.solr.search.SyntaxError: Cannot parse
 '*mm_state_code:(**TX)*': Encountered  : :  at line 1, column 14.
 Was expecting one of:
 EOF
 AND ...
 OR ...
 NOT ...
 + ...
 - ...
 BAREOPER ...
 ( ...
 * ...
 ^ ...
 QUOTED ...
 TERM ...
 FUZZY_SLOP ...
 PREFIXTERM ...
 WILDTERM ...
 REGEXPTERM ...
 [ ...
 { ...
 LPARAMS ...
 NUMBER ...
 /str
   int name=code400/int
 /lst
 /response

 Not sure why the data wont show up. Almost all the records has the field
 sa_site_city has data and is also indexed. :(



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065406.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Solr Faceting doesn't return values.

2013-05-22 Thread samabhiK
Hello,

I have a field defined in my schema.xml like so:

field name=sa_site_city type=string indexed=true stored=true/

string is a type :

fieldType name=string class=solr.StrField sortMissingLast=true /

When I run the query for faceting data by the city:

http://XX.XX.XX.XX/solr/collection1/select?q=mm_state_codewt=jsonindent=truefacet=truefacet.field=sa_site_city

 I get empty result like so:

{
  responseHeader:{
status:0,
QTime:1,
params:{
  facet:true,
  indent:true,
  q:mm_state_code,
  facet.field:sa_site_city,
  wt:json}},
  response:{numFound:0,start:0,docs:[]
  },
  facet_counts:{
facet_queries:{},
facet_fields:{
  sa_site_city:[]},
facet_dates:{},
facet_ranges:{}}}

I wonder what am I doing wrong?





--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Faceting doesn't return values.

2013-05-22 Thread Erick Erickson
Probably you're not querying the field you think you are. Try adding
debug=all to the URL and I think you'll see something like

default_search_field:mm_state_code

Which means you're searching for the literal phrase mm_state_code in
your default search field (defined in solrconfig.xml for the handler
you're using).

You won't get any facets if you don't have any documents that match.

Best
Erick

On Wed, May 22, 2013 at 7:42 AM, samabhiK qed...@gmail.com wrote:
 Hello,

 I have a field defined in my schema.xml like so:

 field name=sa_site_city type=string indexed=true stored=true/

 string is a type :

 fieldType name=string class=solr.StrField sortMissingLast=true /

 When I run the query for faceting data by the city:

 http://XX.XX.XX.XX/solr/collection1/select?q=mm_state_codewt=jsonindent=truefacet=truefacet.field=sa_site_city

  I get empty result like so:

 {
   responseHeader:{
 status:0,
 QTime:1,
 params:{
   facet:true,
   indent:true,
   q:mm_state_code,
   facet.field:sa_site_city,
   wt:json}},
   response:{numFound:0,start:0,docs:[]
   },
   facet_counts:{
 facet_queries:{},
 facet_fields:{
   sa_site_city:[]},
 facet_dates:{},
 facet_ranges:{}}}

 I wonder what am I doing wrong?





 --
 View this message in context: 
 http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276.html
 Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Faceting doesn't return values.

2013-05-22 Thread samabhiK
Ok after I added debug=all to the query, I get:

{
  responseHeader:{
status:0,
QTime:11,
params:{
  facet:true,
  indent:true,
  q:mm_state_code,
  debug:all,
  facet.field:sa_site_city,
  wt:json}},
  response:{numFound:0,start:0,docs:[]
  },
  facet_counts:{
facet_queries:{},
facet_fields:{
  sa_site_city:[]},
facet_dates:{},
facet_ranges:{}},
  debug:{
rawquerystring:mm_state_code,
querystring:mm_state_code,
parsedquery:sa_property_id:mm_state_code,
parsedquery_toString:sa_property_id:mm_state_code,
explain:{},
QParser:LuceneQParser,
timing:{
  time:4.0,
  prepare:{
time:2.0,
query:{
  time:0.0},
facet:{
  time:0.0},
mlt:{
  time:0.0},
highlight:{
  time:0.0},
stats:{
  time:0.0},
debug:{
  time:0.0}},
  process:{
time:1.0,
query:{
  time:0.0},
facet:{
  time:0.0},
mlt:{
  time:0.0},
highlight:{
  time:0.0},
stats:{
  time:0.0},
debug:{
  time:1.0}

I have not defined any default facet filed, in the handler in solrconfig.xml
file.
Also, there is plenty of data available and the field sa_site_city

What I am trying to understand is this:

parsedquery:sa_property_id:mm_state_code

I have a field sa_property_id in the schema but i have not defined it in the
query nor in solrconfig.xml, but why is it still evaluated? Any help in
solving this problem will be greatly appreciated.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065294.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Faceting doesn't return values.

2013-05-22 Thread samabhiK
Ok my bad.

I do have a default field defined in the /select handler in the config file.

lst name=defaults
   str name=echoParamsexplicit/str
   int name=rows10/int
   str name=dfsa_property_id/str
/lst

But then how do I change my query now?




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065298.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Faceting doesn't return values.

2013-05-22 Thread Sandeep Mestry
Hi There,

Not sure I understand your problem correctly, but is 'mm_state_code' a real
value or is it field name?
Also, as Erick pointed out above, the facets are not calculated if there
are no results. Hence you get no facets.

You have mentioned which facets you want but you haven't mentioned which
field you want to search against. That field should be defined in df
parameter instead of sa_property_id.

Can you post example solr document you're indexing?

-Sandeep


On 22 May 2013 14:28, samabhiK qed...@gmail.com wrote:

 Ok my bad.

 I do have a default field defined in the /select handler in the config
 file.

 lst name=defaults
str name=echoParamsexplicit/str
int name=rows10/int
str name=dfsa_property_id/str
 /lst

 But then how do I change my query now?




 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065298.html
 Sent from the Solr - User mailing list archive at Nabble.com.



Re: Solr Faceting doesn't return values.

2013-05-22 Thread samabhiK
Thanks for your reply.

I have my request url modified like this:
http://xx.xx.xx.xx/solr/collection1/select?q=TXdf=mm_state_codewt=xmlindent=truefacet=truefacet.field=sa_site_citydebug=all

Facet Filed = sa_site_city ( city wise facet)
Default Filed = mm_state_code
Query= TX

When I run this query, I get something like this:

?xml version=1.0 encoding=UTF-8?
response

lst name=responseHeader
  int name=status0/int
  int name=QTime3/int
  lst name=params
str name=facettrue/str
str name=dfsa_site_city/str
str name=indenttrue/str
str name=qTX/str
str name=_1369238921109/str
str name=debugall/str
str name=facet.fieldsa_site_city/str
str name=wtxml/str
  /lst
/lst
result name=response numFound=0 start=0
/result
lst name=facet_counts
  lst name=facet_queries/
  lst name=facet_fields
lst name=sa_site_city/
  /lst
  lst name=facet_dates/
  lst name=facet_ranges/
/lst
lst name=debug
  str name=rawquerystringTX/str
  str name=querystringTX/str
  str name=parsedquerysa_site_city:TX/str
  str name=parsedquery_toStringsa_site_city:TX/str
  lst name=explain/
  str name=QParserLuceneQParser/str
  lst name=timing
double name=time2.0/double
lst name=prepare
  double name=time0.0/double
  lst name=query
double name=time0.0/double
  /lst
  lst name=facet
double name=time0.0/double
  /lst
  lst name=mlt
double name=time0.0/double
  /lst
  lst name=highlight
double name=time0.0/double
  /lst
  lst name=stats
double name=time0.0/double
  /lst
  lst name=debug
double name=time0.0/double
  /lst
/lst
lst name=process
  double name=time2.0/double
  lst name=query
double name=time1.0/double
  /lst
  lst name=facet
double name=time1.0/double
  /lst
  lst name=mlt
double name=time0.0/double
  /lst
  lst name=highlight
double name=time0.0/double
  /lst
  lst name=stats
double name=time0.0/double
  /lst
  lst name=debug
double name=time0.0/double
  /lst
/lst
  /lst
/lst
/response

I do have the data in my index and that I verified by running other queries.
I can't figure out what I am missing.








--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065360.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Faceting doesn't return values.

2013-05-22 Thread Sandeep Mestry
From the response you've mentioned it appears to me that the query term TX
is searched against sa_site_city instead of mm_state_code.
Can you try your query like below:

http://xx.xx.xx.xx/solr/collection1/select?q=*mm_state_code:(**TX)*
wt=xmlindent=truefacet=truefacet.field=sa_site_citydebug=all

and post your output?

On 22 May 2013 17:13, samabhiK qed...@gmail.com wrote:

 str name=dfsa_site_city/str


Re: Solr Faceting doesn't return values.

2013-05-22 Thread samabhiK
When I use your query, I get :

?xml version=1.0 encoding=UTF-8?
response

lst name=responseHeader
  int name=status400/int
  int name=QTime12/int
  lst name=params
str name=facettrue/str
str name=dfmm_state_code/str
str name=indenttrue/str
str name=q*mm_state_code:(**TX)*/str
str name=_1369244078714/str
str name=debugall/str
str name=facet.fieldsa_site_city/str
str name=wtxml/str
  /lst
/lst
lst name=error
  str name=msgorg.apache.solr.search.SyntaxError: Cannot parse
'*mm_state_code:(**TX)*': Encountered  : :  at line 1, column 14.
Was expecting one of:
EOF 
AND ...
OR ...
NOT ...
+ ...
- ...
BAREOPER ...
( ...
* ...
^ ...
QUOTED ...
TERM ...
FUZZY_SLOP ...
PREFIXTERM ...
WILDTERM ...
REGEXPTERM ...
[ ...
{ ...
LPARAMS ...
NUMBER ...
/str
  int name=code400/int
/lst
/response

Not sure why the data wont show up. Almost all the records has the field
sa_site_city has data and is also indexed. :(  



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Faceting-doesn-t-return-values-tp4065276p4065406.html
Sent from the Solr - User mailing list archive at Nabble.com.