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 Pigeyre Romain <ro...@sopra.com> on 2014/09/09 13:36:39 UTC
Using def function in fl criteria,
Hi
I'm trying to use a query with fl=name_UK,name_FRA,itemDesc:def(name_UK,name_FRA)
As you can see, the itemDesc field (builded by solr) is truncated :
{
"name_UK": "MEN S SUIT\n",
"name_FRA": "24 RELAX 2 BTS ST GERMAIN TOILE FLAMMEE LIN ET SOIE",
"itemDesc": "suit"
}
Do you have any idea to change it?
Thanks.
Regards,
Romain
Re: Using def function in fl criteria,
Posted by Chris Hostetter <ho...@fucit.org>.
: I'm trying to use a query with fl=name_UK,name_FRA,itemDesc:def(name_UK,name_FRA)
: As you can see, the itemDesc field (builded by solr) is truncated :
functions get their values from the FieldCache (or DocValues if you've
enabled them) so that they can be efficient across a lot of docs.
based on what you are getting back from the def() funcion, you almost
certainly have a fieldTYpe for name_UK that uses an analyzer that
tokenizes the field, so you're getting back one of the indexed terms.
you could theoretically index these fields again using something like
StrField or KeyworkTokenizerFactory and use that via the def() function --
but honestly that's going to be a lot less efficient then just letting
your client pick bewtween the two values, or writting your own
DocTransformer to conditionally rename/remove the stored field values you
don't want...
https://lucene.apache.org/solr/4_10_0/solr-core/org/apache/solr/response/transform/TransformerFactory.html
-Hoss
http://www.lucidworks.com/
Re: Using def function in fl criteria,
Posted by Erick Erickson <er...@gmail.com>.
I'm really confused about what you're trying to do here. What do you
intend the syntax
itemDesc:def(name_UK,name_FRA)
to do?
It's also really difficult to say much of anything unless we see the
schema definition for "itemDesc" and sample input.
Likely you're somehow applying an analysis chain that is truncating
the input. Or it's also possible that you aren't indexing quite what
you think you are.
Best,
Erick
On Tue, Sep 9, 2014 at 4:36 AM, Pigeyre Romain <ro...@sopra.com> wrote:
> Hi
>
> I'm trying to use a query with fl=name_UK,name_FRA,itemDesc:def(name_UK,name_FRA)
> As you can see, the itemDesc field (builded by solr) is truncated :
>
> {
> "name_UK": "MEN S SUIT\n",
> "name_FRA": "24 RELAX 2 BTS ST GERMAIN TOILE FLAMMEE LIN ET SOIE",
> "itemDesc": "suit"
> }
>
> Do you have any idea to change it?
>
> Thanks.
>
> Regards,
>
> Romain