tags:

views:

56

answers:

1

1)I have a field storing timestamp as text (YYYYMMDDHHMM). Can i get the results as i get with date faceting? (July(30),August(54) etc) As per my knowledge Solr currently doesn't support range faceting, even if it does in the future , text will not be recognized as integer/long.

2)Is there any way to get total count of facet results for a particular query in an efficient way?

Thanks,

A: 
  1. Even though faceting by range isn't supported in Solr 1.4.x, you can use facet.query to facet by any arbitrary query. So you can build facet queries like facet.query=timestamp:[201006010000 TO 201006302359] for June, facet.query=timestamp:[201007010000 TO 201007312359] for July, etc. Use a copyField to query against a trie field for optimum performance.

  2. Add them up client-side.

Mauricio Scheffer
Thanks a lot for the help.
kaka
I need the result which looks like jan2009(30), feb2009(45)...aug2010(14).Then i need to include facet.query=... 20 times in the query. Is there any way to shorten the query?
kaka
@kaka: this is as short as it gets. Anyway what does it matter? you're using a for loop to build these 20 queries, right?
Mauricio Scheffer
Yeah,but it matters as there is a limit on url length ,adding to this i have large number of shards.I am using jetty and cant find a way to increase the limit.Any suggestions?Thanks,kaka
kaka
@kaka: right, that is a good reason! :-) use a POST request instead of GET. POST doesn't have any such limits. Not sure if shards supports POSTs though.
Mauricio Scheffer
:) and its causing lot of trouble, is there some way to tell solr to search all shards(without naming them all) of the solr instance? Looks like an easy feature to implement but could not find any pointers
kaka
Mauricio Scheffer
Thanks, that seems to be a good option, but its not working for me.when i add shards as a default parameter, query is never returned :(. Did any one try this before?
kaka
@kaka. sorry, no. Try creating another question for that.
Mauricio Scheffer