Query regarding Dynamic Fields

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Query regarding Dynamic Fields

jay harkhani
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.
Reply | Threaded
Open this post in threaded view
|

RE: Query regarding Dynamic Fields

Bruno Mannina
Hi Jay,

In my case, I created a CopyField for this case.

i.e.
<copyField source="ABC_*" dest="ABC"/>

And of course define ABC before
<field name="ABC" type="text_general" indexed="true" stored="true"
multiValued="true"/>



-----Message d'origine-----
De : jay harkhani [mailto:[hidden email]]
Envoyé : mercredi 5 décembre 2018 13:29
À : [hidden email]
Objet : 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.


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

Reply | Threaded
Open this post in threaded view
|

Re: Query regarding Dynamic Fields

jay harkhani
Hello Bruno,

Thanks for you suggestion.

But in our use case there are large no. of fields so every time making copy field will not feasible.

i.e.: fields: ABC_Field/Start_Date, ABD_Field/Complete_Date, ABD_Field/info/User_Name, ABD_Field/info/Email

As we use in return field i.e.: *Start_Date, *Complete_Date, *User_Name. Similar We need to use field name to make search query.

Regards,
Jay Harkhani.

________________________________
From: Bruno Mannina <[hidden email]>
Sent: Wednesday, December 5, 2018 6:20 PM
To: [hidden email]
Subject: RE: Query regarding Dynamic Fields

Hi Jay,

In my case, I created a CopyField for this case.

i.e.
<copyField source="ABC_*" dest="ABC"/>

And of course define ABC before
<field name="ABC" type="text_general" indexed="true" stored="true"
multiValued="true"/>



-----Message d'origine-----
De : jay harkhani [mailto:[hidden email]]
Envoyé : mercredi 5 décembre 2018 13:29
À : [hidden email]
Objet : 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.


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

Reply | Threaded
Open this post in threaded view
|

Re: Query regarding Dynamic Fields

Erick Erickson
bq:  so every time making copy field will not feasible

What's your evidence? If you have a zillion documents and a very large
corpus, that's one thing. But 10M docs isn't very much and you can use
copyFields all over the place.

Plus do you have to search the fields separately too? If not, storing
but not indexing the original field and indexing but not storing the
copyField destination creates an index of roughly the same size as
storing+indexing the original fields only.

Solr simply has no support for wildcards as the field of a search, i.e
ABC*:some_search_value. So either you need to use some kind of
copyField trick or take a look at your architecture. This may well be
an XY problem, you haven't really told us _why_ you think you need all
these dynamic fields, what use-case are you trying to solve? Have you
considered payloads for instance? Whether they apply is impossible to
suggest without more information.

Best,
Erick
On Thu, Dec 6, 2018 at 5:08 AM jay harkhani <[hidden email]> wrote:

>
> Hello Bruno,
>
> Thanks for you suggestion.
>
> But in our use case there are large no. of fields so every time making copy field will not feasible.
>
> i.e.: fields: ABC_Field/Start_Date, ABD_Field/Complete_Date, ABD_Field/info/User_Name, ABD_Field/info/Email
>
> As we use in return field i.e.: *Start_Date, *Complete_Date, *User_Name. Similar We need to use field name to make search query.
>
> Regards,
> Jay Harkhani.
>
> ________________________________
> From: Bruno Mannina <[hidden email]>
> Sent: Wednesday, December 5, 2018 6:20 PM
> To: [hidden email]
> Subject: RE: Query regarding Dynamic Fields
>
> Hi Jay,
>
> In my case, I created a CopyField for this case.
>
> i.e.
> <copyField source="ABC_*" dest="ABC"/>
>
> And of course define ABC before
> <field name="ABC" type="text_general" indexed="true" stored="true"
> multiValued="true"/>
>
>
>
> -----Message d'origine-----
> De : jay harkhani [mailto:[hidden email]]
> Envoyé : mercredi 5 décembre 2018 13:29
> À : [hidden email]
> Objet : 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.
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
> https://www.avast.com/antivirus
>