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 michallos <mi...@gmail.com> on 2013/11/29 11:22:24 UTC

Lowercase field

Hi,

How can process one of the fields in query to be lower case? This field is
of type StrField and what is very important I can't change schema (for
example to TextField with LowerCase filter). I also can't change query that
is passed by HTTP. Is it possible to do that in configuration?

Example:
q=testField:TeSt should be transformed to q=testField:test



--
View this message in context: http://lucene.472066.n3.nabble.com/Lowercase-field-tp4103848.html
Sent from the Solr - User mailing list archive at Nabble.com.

Block join and child doc facet counts

Posted by Stefan Moises <mo...@shoptimax.de>.
Hi,

I was playing around with the relatively new block join features in Solr 
4.6., because I need parent-child relations in my documents.
Until now, we are using Solr 4.2.1 with custom plugins, where we have 
integrated some JIRA patches (mainly 
https://issues.apache.org/jira/browse/SOLR-2272) to support (block) 
joins, but now I thought we might get rid of our patched version with 
custom extensions which we need to update with every Solr release.

Anyhow, the block join itself seems to work, but there is still one 
major drawback for me - faceting doesn't really make too much sense for 
me using the block join, because the facet counts are based on the 
parent docs if I join from childs to parents.

So in my example, I have e.g. 6 blue t-shirts in different sizes, when I 
join them to parent docs, I have 2 t-shirts, which is fine because I 
only want to list the parent articles in my results.. but when I facet 
over sizes and colors, I *expect* to get the child facet counts, e.g.
att_color
     blue    6
     red    4
     green    2
att_size
     S    4
     L    2
     XL    6
att_price
     12.99    6

so that I can filter further down to my right child article.

But all I *get* is the parent counts, e.g.
att_color
     blue 0
     red    0
     green 0
att_size
     S    0
     L    0
     XL    0
att_price
     12.99    6

where I have no chance to filter down to my desired size etc.

Here is a sample query I use:
http://localhost:8983/solr-4.6.0/ee/select?q={!parent%20which=%27type_s:parent%27}%2Batt_Farbe:Dark-Blue&wt=xml&facet=true&facet.field=att_Groesse&facet.field=oxprice&facet.field=att_Farbe

There is a good description of block joins and the current drawbacks 
here: http://blog.griddynamics.com/2013/09/solr-block-join-support.html
where the author also states:
"


      Faceting

Facet component for block indexes is quite useful in eCommerce. The 
trickiest thing is to count SKU field values and aggregate them into 
product counts like it was described at the earlier posts 
<http://blog.griddynamics.com/2011/10/solr-experience-search-parent-child.html>. 

"

Will this be fixed / added in one of the upcoming versions or do I have 
to stick with our custom plugins (where we /do/ aggregate the child 
counts into the parent counts) and update them for Solr 4.6.?

Thank you very much,
Stefan

Re: Lowercase field

Posted by Erik Hatcher <er...@gmail.com>.
No, there's no simpler thing to do here.   When a StrField is indexed, it is indexed as-is, CaseAndAll.   Unless you're using fuzzy/regex/multi-term queries, the terms have to be exact.  

I suppose you could do some kind of regex query: q=field:/[Ff][Oo][Oo]/ , maybe?

	Erik

On Nov 29, 2013, at 7:00 AM, michallos <mi...@gmail.com> wrote:

> Unfortunately indexing takes more than 3 days (hundreds of millions of
> documents) so it is impossible to do that right now. Any other ideas to do
> simple .toLowerCase() on one field?
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Lowercase-field-tp4103848p4103866.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Lowercase field

Posted by michallos <mi...@gmail.com>.
Unfortunately indexing takes more than 3 days (hundreds of millions of
documents) so it is impossible to do that right now. Any other ideas to do
simple .toLowerCase() on one field?



--
View this message in context: http://lucene.472066.n3.nabble.com/Lowercase-field-tp4103848p4103866.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Lowercase field

Posted by Erik Hatcher <er...@gmail.com>.
You can't change the field type or the request then what can you change?

Sounds like the right thing to do here is use a TextField with a KeywordTokenizer followed by a LowercaseFilter.  If you can't for some reason make that change then I'm at a loss to recommend something different. 

   Erik

On Nov 29, 2013, at 5:22, michallos <mi...@gmail.com> wrote:

> Hi,
> 
> How can process one of the fields in query to be lower case? This field is
> of type StrField and what is very important I can't change schema (for
> example to TextField with LowerCase filter). I also can't change query that
> is passed by HTTP. Is it possible to do that in configuration?
> 
> Example:
> q=testField:TeSt should be transformed to q=testField:test
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Lowercase-field-tp4103848.html
> Sent from the Solr - User mailing list archive at Nabble.com.