Is there a way to use MultiFieldQuery in combination with NumericRanges in Lucene?

I am currently creating and viewing this with a MultiFieldQueryParser. I have about 20 different fields for all different data types, and I would like the search to take them all into account. Here's how I create a parser and get the request object:

MultiFieldQueryParser mfqp = new MultiFieldQueryParser(
                keyHashSet.toArray(new String[] {}), analyzer);

mfqp.setAllowLeadingWildcard(true);

Query q = mfqp.parse(search);

System.out.println(q.getClass());

      

Where keyHashSet has all my data keys.

Whenever I pass a range request like:

Heading:[0 to 360]

      

The class returned from the printout is

class org.apache.lucene.search.TermRangeQuery

      

Although I'm setting up the Title field like this:

doc.add(new FloatField("Heading", value, Field.Store.YES));

      

Is there a way to accomplish NumericRangeQuery

with MultiFieldQueryParser

?

+3
java information-retrieval lucene


source to share


No one has answered this question yet

Check out similar questions:

1823
What's the easiest way to print a Java array?
1367
Fastest way to determine if an integer square root is an integer
3
Lucene parser for indexing and searching
1
Make the row range of a Lucene field searchable
1
lucene.net fuzzy plural words
1
Can Lucene.Net (3.0.3 or 4.8.0) QueryParser look up numbers?
0
Lucene search across multiple fields but matches any
0
Extracting Value fields using Lucene
0
Best Way to Build Lucene Search Index for Finding Contacts
0
Lucene.NET 2.9 - MultiFieldQueryParser, extended fields, stems and prefixes



All Articles
Loading...
X
Show
Funny
Dev
Pics