Package com.flaptor.indextank.index

Examples of com.flaptor.indextank.index.Document.asMap()


            // fetch fields
            for (String field : fetchFields) {
                    // handle '*', as a fetch all
                    if ("*".equals(field.trim())){
                        // assume we get the actual fields, not a copy.
                        result.getFields().putAll(data.asMap());
                        break;
                    }
                    String text = data.getField(field);
                    if (null != text) {
                        result.setField(field, text);
View Full Code Here


        String docid = "docid";
        Document doc = new Document(ImmutableMap.of("text", "this is a sample text", "title", "a headline!"));
        indexer.add(docid, doc, (int)timestampBoost, Maps.<Integer, Double>newHashMap());
        SearchResults srs = searcher.search(new Query(new TermQuery("text","sample"),null,null),0,10, 0, ImmutableMap.of("fetch_fields", "*"));
        SearchResult sr = srs.getResults().iterator().next();
        assertEquals("document data modified. fetch_fields='*' should retrieve the same data.", sr.getFields(), doc.asMap());
    }

}
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.