Re: hierarchical faceting?

2012-04-18 Thread Charlie Maroto
 The PathHierarchyTokenizerFactory is intended for file path therefore
assumes that all documents should be indexed with all of the paths to the
parent folders but you are trying to use it for a taxonomy so you can't
simply use the PathHierarchyTokenizerFactory.   Use the analysis page (
http://localhost:8983/solr/admin/analysis.jsp) so that you can see what's
happening with the content both at index and query time.

Field  (Type)  text_path
Field value (Index)  red/pink
Field value (Query) red/pink
You'd notice that the result of both is identical, therefore explaining why
both documents are retrieved:

Index Analyzer:
   red
   red/pink
Query Analyzer:
   red
   red/pink

 Carlos

-Original Message-
From: Darren Govoni [mailto:dar...@ontrenet.com]
Sent: Wednesday, April 18, 2012 8:10 AM
To: solr-user@lucene.apache.org
Subject: Re: hierarchical faceting?



Put the parent term in all the child documents at index time and the
re-issue the facet query when you expand the parent using the parent's
term. works perfect.



On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:

 I have hierarchical colors:

 field name=colors type=text_pathindexed=true

 stored=true multiValued=true/

 text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.



 Given these two documents,

 Doc1: red

 Doc2: red/pink



 I want the result to be the following:

 ?fq=red

 == Doc1, Doc2



 ?fq=red/pink

 == Doc2



 But, with PathHierarchyTokenizer, Doc1 is included for the query:

 ?fq=red/pink

 == Doc1, Doc2



 How can I query for hierarchical facets?

 http://wiki.apache.org/solr/HierarchicalFaceting describes facet.prefix..

 But it looks too cumbersome to me.



 Is there a simpler way to implement hierarchical facets?


Re: Using DateMath in Facet Label

2012-04-10 Thread Charlie Maroto
Hi Chris,

c) would cover the last year to the current date, therefore, as I write
this it would be the period between Apr11, 2011 and Apr 10, 2012.
Therefore, the period begin and end dates would increase by one
day tomorrow.  d) represents the current calendar year, thus covering Jan
1, 2012 - Apr 10, 2012 (at the moment of writing this reply).

Thanks for your suggestion, that was pretty much what we did around the
time of sending the email but we were hoping to find a way to make it more
dynamic out of Solr.

Carlos

From: Chris Hostetter [hossman_luc...@fucit.org]
Sent: Tuesday, April 10, 2012 12:40 PM
To: solr-user@lucene.apache.org
Subject: Re: Using DateMath in Facet Label

: a)  Last Week
: b)  Last Month
: c)   Last Year
: d)  2012
: e)  2011 or earlier
...
: Of course, as 2013 rolls in, then the labels for the last two buckets
: should change to “2013” and “2012 or earlier”.  Is there any way to have
: Solr return the correct year based on the current date?  For example, I

first off: i don't understand how #c and #d are different -- but to answer
your question, no.

my suggestion would either be to use simple keys that your front end then
uses to translate into what it displays to the user (ie: curr_week,
curr_month, curr_year, last_year, old) or just have your front end
app parse the date math expressions itself.


-Hoss


On Mon, Mar 26, 2012 at 6:32 AM, Charlie Maroto charlie.mar...@gmail.comwrote:

 Hi,



 We have a requirement to facet on a field with a date value so that the
 following buckets are shown:



 a)  Last Week

 b)  Last Month

 c)   Last Year

 d)  2012

 e)  2011 or earlier



 Of course, as 2013 rolls in, then the labels for the last two buckets
 should change to “2013” and “2012 or earlier”.  Is there any way to have
 Solr return the correct year based on the current date?  For example, I
 thought of trying to do something like this for d) above:



 …facet.query={!key=[NOW-1YEAR/YEAR]}date_entered:[NOW-1YEAR/YEAR TO
 NOW/YEAR]...


 Thanks,
 Carlos



Using DateMath in Facet Label

2012-03-26 Thread Charlie Maroto
Hi,



We have a requirement to facet on a field with a date value so that the
following buckets are shown:



a)  Last Week

b)  Last Month

c)   Last Year

d)  2012

e)  2011 or earlier



Of course, as 2013 rolls in, then the labels for the last two buckets
should change to “2013” and “2012 or earlier”.  Is there any way to have
Solr return the correct year based on the current date?  For example, I
thought of trying to do something like this for d) above:



…facet.query={!key=[NOW-1YEAR/YEAR]}date_entered:[NOW-1YEAR/YEAR TO
NOW/YEAR]...


Thanks,
Carlos


Solr Analyzed or parsedquery Terms

2012-02-26 Thread Charlie Maroto
Hi all,

*Question*
Is there a way to get the analyzed or parsedquery terms for a given search?
 Preferably along with the search results

*What are we looking for?*
Something that would tell us what are the actual terms searched by Solr
after all tokenization, analysis and filtering have been applied.  The
terms “accelerates downloading” are a simple example of how terms are
modified by our Solr config before the search is done.  Other complications
would arise if search terms typed in by the user include uppercase letters
(“Download Accelerator”), punctuation marks or special characters of any
kind (“i-Pod”), etc.  So, we are looking for something like the acceler
download portion of the parsedquery in the Solr debug output:

   rawquerystring:accelerates downloading,
   querystring:accelerates downloading,
   …
   parsedquery_toString: … (content:\*acceler download*\^2.0)
,

Another example of what we want is what you can get via the Field Analysis
page (http://localhost:8983/solr/admin/analysis.jsp), as in the attached
image.

Thanks,

CARLOS