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 jay harkhani <ja...@hotmail.com> on 2018/11/27 12:21:15 UTC
Query regarding Dynamic Fields
Hello All,
We are using dynamic fields in our collection. We want to use it in query to fetch records. Can someone please advice on it?
i.e.: q=ABC_*:"myValue"
Here "ABC_*" is dynamic field. Currently when we tried if provide field name as above it gives "org.apache.solr.search.SyntaxError". It only returns data when provide actual field name.
Thank you for any help you can offer.
Regards,
Jay Harkhani.
Re: Query regarding Dynamic Fields
Posted by Alexandre Rafalovitch <ar...@gmail.com>.
However, to add to Edward's message, you can with eDismax create
synthetic field names that expand to multiple fields under the covers,
using per-field 'qf' parameter.
See: https://lucene.apache.org/solr/guide/7_5/the-extended-dismax-query-parser.html#field-aliasing-using-per-field-qf-overrides
An example (1 to 1, but still):
https://github.com/arafalov/solr-indexing-book/blob/master/published/languages/conf/solrconfig.xml#L24-L55
Regards,
Alex.
On Tue, 27 Nov 2018 at 15:19, Edward Ribeiro <ed...@gmail.com> wrote:
>
> You should provide the full name of the dynamic field in the query like
> q=s_myfield:foo, for example. Solr doesn't allow field prefix queries like
> q=s_*:foo.
>
> Edward
>
>
> Em 27 de nov de 2018 12:08, "jay harkhani" <ja...@hotmail.com>
> escreveu:
>
> Hello All,
>
>
> We are using dynamic fields in our collection. We want to use it in query
> to fetch records. Can someone please advice on it?
>
> i.e.: q=ABC_*:"myValue"
>
> Here "ABC_*" is dynamic field. Currently when we tried if provide field
> name as above it gives "org.apache.solr.search.SyntaxError". It only
> returns data when provide actual field name.
>
> Thank you for any help you can offer.
>
> Regards,
> Jay Harkhani.
Re: Query regarding Dynamic Fields
Posted by Edward Ribeiro <ed...@gmail.com>.
You should provide the full name of the dynamic field in the query like
q=s_myfield:foo, for example. Solr doesn't allow field prefix queries like
q=s_*:foo.
Edward
Em 27 de nov de 2018 12:08, "jay harkhani" <ja...@hotmail.com>
escreveu:
Hello All,
We are using dynamic fields in our collection. We want to use it in query
to fetch records. Can someone please advice on it?
i.e.: q=ABC_*:"myValue"
Here "ABC_*" is dynamic field. Currently when we tried if provide field
name as above it gives "org.apache.solr.search.SyntaxError". It only
returns data when provide actual field name.
Thank you for any help you can offer.
Regards,
Jay Harkhani.