You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Cristian Lorenzetto <cr...@gmail.com> on 2017/03/17 18:05:36 UTC

search any field name having a specific value

it is possible create a query searching any document containing any field
having value == X?

Re: search any field name having a specific value

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi,

You can retrieve the list of field names using LukeRequestHandler.

Ahmet


On Friday, March 17, 2017 9:53 PM, Cristian Lorenzetto <cr...@gmail.com> wrote:



It permits to search in a predefined lists of fields that you have to know
in advance. In my case i dont know what is the fieldname.
maybe WildcardQuery?


2017-03-17 19:30 GMT+01:00 Corbin, J.D. <jd...@pearson.com>:

> ​You might take a look at MultiFieldQueryParser.  I believe it allows you
> to search multiple index fields at the same time.
>
>
>
> J.D. Corbin
>
> Senior Research Engineer
>
> Advanced Computing & Data Science Lab
>
> 3075 W. Ray Road
> Suite 200
> Chandler, AZ 85226-2495
> USA
>
>
> M: (303) 912-0958
>
> E: jd.corbin@pearson.com
>
> Pearson
>
> Always Learning
> Learn more at www.pearson.com <http://www.pearsonk12.com/>
>
> On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
> cristian.lorenzetto@gmail.com> wrote:
>
> > it is possible create a query searching any document containing any field
> > having value == X?
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: search any field name having a specific value

Posted by "Corbin, J.D." <jd...@pearson.com>.
Hi, I am not sure if there is a way to specify a search against all fields
in the index without knowing the fields.

WildcardQuery probably won't work since it does target a specific field
within the index.  The specification of the index field comes in the
definition of the Term that is passed as an argument to the constructor.

Also, not sure what your specific use case is, but there is no guarantee
that all the documents in the index contain the same field definitions.  An
index can contain documents with varying numbers and types of fields.s


On Fri, Mar 17, 2017 at 11:53 AM, Cristian Lorenzetto <
cristian.lorenzetto@gmail.com> wrote:

> It permits to search in a predefined lists of fields that you have to know
> in advance. In my case i dont know what is the fieldname.
> maybe WildcardQuery?
>
> 2017-03-17 19:30 GMT+01:00 Corbin, J.D. <jd...@pearson.com>:
>
> > ​You might take a look at MultiFieldQueryParser.  I believe it allows you
> > to search multiple index fields at the same time.
> >
> >
> > On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
> > cristian.lorenzetto@gmail.com> wrote:
> >
> > > it is possible create a query searching any document containing any
> field
> > > having value == X?
> > >
> >
>

Re: search any field name having a specific value

Posted by Marco Reis <ma...@marcoreis.net>.
You can add a new field called "full_text" and during the indexing time you
concatenate all the values of the other fields in it.
Do you think it's a good idea for this case?



On Fri, Mar 17, 2017 at 6:27 PM Lokesh Madan <ma...@gmail.com> wrote:

> May be, index the field names as metadata file. When when querying, first
> get list of alls fields and then shoot a query. You can do this 2 hop
> query, or else maintain some cache and then shoot a query.
> > On Mar 17, 2017, at 11:53 AM, Cristian Lorenzetto <
> cristian.lorenzetto@gmail.com> wrote:
> >
> > It permits to search in a predefined lists of fields that you have to
> know
> > in advance. In my case i dont know what is the fieldname.
> > maybe WildcardQuery?
> >
> > 2017-03-17 19:30 GMT+01:00 Corbin, J.D. <jd...@pearson.com>:
> >
> >> ​You might take a look at MultiFieldQueryParser.  I believe it allows
> you
> >> to search multiple index fields at the same time.
> >>
> >>
> >>
> >> J.D. Corbin
> >>
> >> Senior Research Engineer
> >>
> >> Advanced Computing & Data Science Lab
> >>
> >> 3075 W. Ray Road
> >> Suite 200
> >> Chandler, AZ 85226-2495
> >> USA
> >>
> >>
> >> M: (303) 912-0958
> >>
> >> E: jd.corbin@pearson.com
> >>
> >> Pearson
> >>
> >> Always Learning
> >> Learn more at www.pearson.com <http://www.pearsonk12.com/>
> >>
> >> On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
> >> cristian.lorenzetto@gmail.com> wrote:
> >>
> >>> it is possible create a query searching any document containing any
> field
> >>> having value == X?
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
> --
Marco Reis
Software Architect
http://marcoreis.net
https://github.com/masreis
+55 61 81194620

Re: search any field name having a specific value

Posted by Lokesh Madan <ma...@gmail.com>.
May be, index the field names as metadata file. When when querying, first get list of alls fields and then shoot a query. You can do this 2 hop query, or else maintain some cache and then shoot a query.
> On Mar 17, 2017, at 11:53 AM, Cristian Lorenzetto <cr...@gmail.com> wrote:
> 
> It permits to search in a predefined lists of fields that you have to know
> in advance. In my case i dont know what is the fieldname.
> maybe WildcardQuery?
> 
> 2017-03-17 19:30 GMT+01:00 Corbin, J.D. <jd...@pearson.com>:
> 
>> ​You might take a look at MultiFieldQueryParser.  I believe it allows you
>> to search multiple index fields at the same time.
>> 
>> 
>> 
>> J.D. Corbin
>> 
>> Senior Research Engineer
>> 
>> Advanced Computing & Data Science Lab
>> 
>> 3075 W. Ray Road
>> Suite 200
>> Chandler, AZ 85226-2495
>> USA
>> 
>> 
>> M: (303) 912-0958
>> 
>> E: jd.corbin@pearson.com
>> 
>> Pearson
>> 
>> Always Learning
>> Learn more at www.pearson.com <http://www.pearsonk12.com/>
>> 
>> On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
>> cristian.lorenzetto@gmail.com> wrote:
>> 
>>> it is possible create a query searching any document containing any field
>>> having value == X?
>>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: search any field name having a specific value

Posted by Cristian Lorenzetto <cr...@gmail.com>.
It permits to search in a predefined lists of fields that you have to know
in advance. In my case i dont know what is the fieldname.
maybe WildcardQuery?

2017-03-17 19:30 GMT+01:00 Corbin, J.D. <jd...@pearson.com>:

> ​You might take a look at MultiFieldQueryParser.  I believe it allows you
> to search multiple index fields at the same time.
>
>
>
> J.D. Corbin
>
> Senior Research Engineer
>
> Advanced Computing & Data Science Lab
>
> 3075 W. Ray Road
> Suite 200
> Chandler, AZ 85226-2495
> USA
>
>
> M: (303) 912-0958
>
> E: jd.corbin@pearson.com
>
> Pearson
>
> Always Learning
> Learn more at www.pearson.com <http://www.pearsonk12.com/>
>
> On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
> cristian.lorenzetto@gmail.com> wrote:
>
> > it is possible create a query searching any document containing any field
> > having value == X?
> >
>

Re: search any field name having a specific value

Posted by "Corbin, J.D." <jd...@pearson.com>.
​You might take a look at MultiFieldQueryParser.  I believe it allows you
to search multiple index fields at the same time.



J.D. Corbin

Senior Research Engineer

Advanced Computing & Data Science Lab

3075 W. Ray Road
Suite 200
Chandler, AZ 85226-2495
USA


M: (303) 912-0958

E: jd.corbin@pearson.com

Pearson

Always Learning
Learn more at www.pearson.com <http://www.pearsonk12.com/>

On Fri, Mar 17, 2017 at 11:05 AM, Cristian Lorenzetto <
cristian.lorenzetto@gmail.com> wrote:

> it is possible create a query searching any document containing any field
> having value == X?
>