Zend Lucene and range search on a field with multiple values
问题 Say my index contains documents with a field called "ages". Example entries for "ages" field: 25 24, 28 25, 31 How would I query this so that I get all the documents whose fields contain ages between 20 and 30? I'm using Zend Lucene. 回答1: lmgtfy :- $from = new Zend_Search_Lucene_Index_Term(20, 'ages'); $to = new Zend_Search_Lucene_Index_Term(30, 'ages'); $query = new Zend_Search_Lucene_Search_Query_Range( $from, $to, true // inclusive ); $hits = $index->find($query); Docs:- http://framework