Examples of SearchHit


Examples of io.druid.query.search.search.SearchHit

  {
    Result<SearchResultValue> r1 = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "foo"
                )
            )
        )
View Full Code Here

Examples of io.druid.query.search.search.SearchHit

  {
    Result<SearchResultValue> r1 = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "foo"
                )
            )
        )
    );

    Result<SearchResultValue> r2 = new Result<SearchResultValue>(
        currTime.plusHours(2),
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah2",
                    "foo2"
                )
            )
        )
    );

    Result<SearchResultValue> expected = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "foo"
                ),
                new SearchHit(
                    "blah2",
                    "foo2"
                )
            )
        )
View Full Code Here

Examples of io.druid.query.search.search.SearchHit

  {
    Result<SearchResultValue> r1 = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "thisislong"
                )
            )
        )
    );

    Result<SearchResultValue> r2 = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "short"
                )
            )
        )
    );

    Result<SearchResultValue> expected = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "short"
                ),
                new SearchHit(
                    "blah",
                    "thisislong"
                )
            )
        )
View Full Code Here

Examples of io.druid.query.search.search.SearchHit

  {
    Result<SearchResultValue> r1 = new Result<SearchResultValue>(
        currTime,
        new SearchResultValue(
            ImmutableList.<SearchHit>of(
                new SearchHit(
                    "blah",
                    "foo"
                )
            )
        )
View Full Code Here

Examples of javax.help.SearchHit

      Enumeration nodesEnum = nodes.elements();
      while (nodesEnum.hasMoreElements()) {
    tocitem = (SearchTOCItem) nodesEnum.nextElement();
    URL testURL = tocitem.getURL();
    if (testURL != null && url != null && url.sameFile(testURL)) {
        tocitem.addSearchHit(new SearchHit(item.getConfidence(),
                   item.getBegin(),
                   item.getEnd()));
        foundNode = true;
        break;
    }
View Full Code Here

Examples of net.sourceforge.pebble.search.SearchHit

public class SearchHitByDateComparatorTest extends SingleBlogTestCase {

  public void testCompare() {
    Comparator comp = new SearchHitByDateComparator();

    SearchHit h1 = new SearchHit(null, "", "", "", "", new Date(321), 1.0F);
    SearchHit h2 = new SearchHit(null, "", "", "", "", new Date(123), 1.0F);

    assertTrue(comp.compare(h1, h1) == 0);
    assertTrue(comp.compare(h1, h2) != 0);
    assertTrue(comp.compare(h1, h2) < 0);
    assertTrue(comp.compare(h2, h1) > 0);
View Full Code Here

Examples of net.sourceforge.pebble.search.SearchHit

public class SearchHitByScoreComparatorTest extends SingleBlogTestCase {

  public void testCompare() {
    Comparator comp = new SearchHitByScoreComparator();

    SearchHit h1 = new SearchHit(null, "", "", "", "", new Date(123), 0.5F);
    SearchHit h2 = new SearchHit(null, "", "", "", "", new Date(321), 0.3F);

    assertTrue(comp.compare(h1, h1) == 0);
    assertTrue(comp.compare(h1, h2) != 0);
    assertTrue(comp.compare(h1, h2) < 0);
    assertTrue(comp.compare(h2, h1) > 0);
View Full Code Here

Examples of net.sourceforge.pebble.search.SearchHit

        Query query = QueryParser.parse(queryString, "blogEntry", getAnalyzer());
        Hits hits = searcher.search(query);

        for (int i = 0; i < hits.length(); i++) {
          Document doc = hits.doc(i);
          SearchHit result = new SearchHit(
              blog,
              doc.get("id"),
              doc.get("permalink"),
              doc.get("title"),
              doc.get("truncatedBody"),
View Full Code Here

Examples of org.elasticsearch.search.SearchHit

      }
    });

    for (int i = 0; i < events.length; i++) {
      Event event = events[i];
      SearchHit hit = hits[i];
      Map<String, Object> source = hit.getSource();
      assertEquals(new String(event.getBody()), source.get("@message"));
    }
  }
View Full Code Here

Examples of org.elasticsearch.search.SearchHit

    protected Map<String, Object> calculateRange(String index) throws EmptyIndexException {
        Map<String, Object> range = Maps.newHashMap();

        Stopwatch x = Stopwatch.createStarted();
        SearchHit doc = searches.firstOfIndex(index);
        if (doc == null || doc.isSourceEmpty()) {
            x.stop();
            throw new EmptyIndexException();
        }

        int rangeStart = Tools.getTimestampOfMessage(doc);
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.