Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Update</strong></p> <p>Possible helpful links:</p> <ul> <li><a href="http://ayende.com/blog/1900/complex-searching-querying-with-nhibernate" rel="nofollow noreferrer">Complex Searching / Querying With NHibernate</a> - Doesn't this accomplish what you're after? The example described allows for search by various number values and ranges.</li> <li><a href="http://jwbs-blog.blogspot.com/2009/03/quickstart-guide-for-nhibernatesearch.html" rel="nofollow noreferrer">Quickstart tutorial for NHibernate.Search</a></li> <li><a href="http://linqtolucene.codeplex.com/" rel="nofollow noreferrer">http://linqtolucene.codeplex.com/</a></li> <li><a href="https://stackoverflow.com/questions/11225552/lucene-hibernate-search-numericrangequeryfloat-not-working-on-field-defined-wi">Lucene hibernate search NumericRangeQuery&lt;Float&gt; not working on field defined with @NumericField</a></li> <li><a href="https://stackoverflow.com/questions/135776/best-place-for-nhibernate-documentation">Best place for NHibernate documentation?</a></li> <li><a href="http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/" rel="nofollow noreferrer">Hibernate Search: Apache Lucene™ Integration Reference Guide</a> <ul> <li><a href="http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#d0e5179" rel="nofollow noreferrer">5.1.2.5. Range queries</a> </li> <li><a href="http://docs.jboss.org/hibernate/search/3.3/reference/en-US/html_single/#numeric-field-annotation" rel="nofollow noreferrer">4.1.1.3. @NumericField</a></li> </ul></li> </ul> <hr> <p>I think both your questions, on numeric and range searches, are addressed here: <a href="http://find.searchhub.org/link?url=http://wiki.apache.org/lucene-java/SearchNumericalFields" rel="nofollow noreferrer">http://find.searchhub.org/link?url=http://wiki.apache.org/lucene-java/SearchNumericalFields</a></p> <blockquote> <p>Because Apache Lucene is a full-text search engine and not a conventional database, it cannot handle numerical ranges (e.g., field value is inside user defined bounds, even dates are numerical values). We have developed an extension to Apache Lucene that stores the numerical values in a special string-encoded format with variable precision (called trie, all numerical values like doubles, longs, Dates, floats, and ints are converted to lexicographic sortable string representations and indexed with different precisions).</p> <p>...</p> <p>Numeric fields can be sorted on (a special parser is included into <a href="http://lucene.apache.org/core/old_versioned_docs/versions/3_0_1/api/core/org/apache/lucene/search/class-use/FieldCache.IntParser.html" rel="nofollow noreferrer">FieldCache</a>) and used in function queries (through <a href="http://lucene.apache.org/core/old_versioned_docs/versions/3_0_1/api/core/org/apache/lucene/search/class-use/FieldCache.IntParser.html" rel="nofollow noreferrer">FieldCache</a>)</p> </blockquote> <p>I also found a <code>LongClass.java</code> implementation via <a href="http://find.searchhub.org/document/c6f73b8c7b407eb3#58e679b347b8b48e" rel="nofollow noreferrer">Range searches for numbers</a>:</p> <blockquote> <p>I implemented a "LongField" that encodes any +ve or -ve long into a string that sorts correctly. I posted that class here: <a href="http://www.mail-archive.com/lucene-dev@jakarta.apache.org/msg04790.html" rel="nofollow noreferrer">http://www.mail-archive.com/lucene-dev@jakarta.apache.org/msg04790.html</a></p> <p>Doing a String range search should be fairly straight forward from there. Let me know if you have any problems.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload