lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Creating dynamic field, but strip the type indicator postfix from the name
Date Fri, 20 May 2016 23:46:33 GMT
Why is this important? I'm failing to see how this helps in
"making the queries simpler to form". What's the difference
between making a query
q=field:value
and
q=field_s:value?

If it's a display issue, it seems like the display app could simply strip
anything after the terminal underscore from the display...

Best,
Erick

On Thu, May 19, 2016 at 5:59 AM, Horváth Péter Gergely
<peter.gergely.horvath@gmail.com> wrote:
> Hi Everyone,
>
> I am wondering if it is possible to store dynamic fields without the type
> indicator postfix. In our Solr environment, I would like to
> 1.) use dynamic fields ("data drivern collections" with no fixed fields
> specified in advance)
> 2.) be able to specify the field type, but without interacting with Solr
> schema API separately
> 3.) I do not want type indicator postfixes to appear in field names, since
> that would make queries more complicated to form.
>
> For example, I could imagine that when I add a document like this:
>
>
>         CloudSolrClient solr  = ...
>
>         SolrInputDocument document = new SolrInputDocument();
>
>         document.addField("foobar_s", "theValue")
>
>         solr.add("someCollection", document);
>
> Solr would recognize that the "foobar_s" field name contains a type
> indicator and it would create a field named "foobar" with the type of
> string.
>
> Is there any way to achieve this behavior (have Solr create the field with
> the requested type, but without the type indicator postfix)? If yes, how
> could I do that?
>
> Thanks,
> Peter

Mime
View raw message