Examples of HitExtractor


Examples of org.springmodules.lucene.search.core.HitExtractor

  public List search(final String fieldName,final String textToSearch) {
    return getLuceneSearcherTemplate().search(new ParsedQueryCreator() {
      public QueryParams configureQuery() {
        return new QueryParams(fieldName, textToSearch);
      }
    }, new HitExtractor() {
      public Object mapHit(int id, Document document, float score) {
        if( document.get("request")!=null ) {
          return new SearchResult(document.get("id"), document.get("request"),
                      score,document.get("category"));
        } else {
View Full Code Here

Examples of org.springmodules.lucene.search.core.HitExtractor

  public List getDocumentFields(final String fieldIdentifier,final String fieldValue) {
    List fieldsDocuments = getLuceneSearcherTemplate().search(new QueryCreator() {
      public Query createQuery(Analyzer analyzer) throws ParseException {
        return new TermQuery(new Term(fieldIdentifier, fieldValue));
      }
    }, new HitExtractor() {
      public Object mapHit(int id, Document document, float score) {
        List fields = new ArrayList();
        for(Enumeration e = document.fields(); e.hasMoreElements();) {
          Field field = (Field)e.nextElement();
          DocumentField documentField = new DocumentField(field.name(), field.stringValue(),
View Full Code Here

Examples of org.springmodules.lucene.search.core.HitExtractor

            query = parser.parse(text);
        } catch (ParseException e) {
            e.printStackTrace();
            throw new SearchQueryParseException(e.getMessage(), e);
        }
        HitExtractor hitExtractor = new ItemIdHitExtractor();
        return template.search(query, hitExtractor);       
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.