Examples of StringText


Examples of org.elasticsearch.common.text.StringText

            } else {
                source = "unknown";
                timeInQueue = -1;
            }

            pendingClusterTasks.add(new PendingClusterTask(pending.insertionOrder, pending.priority, new StringText(source), timeInQueue, pending.executing));
        }
        return pendingClusterTasks;
    }
View Full Code Here

Examples of org.elasticsearch.common.text.StringText

                if (!collateMatch && !collatePrune) {
                    continue;
                }
                Correction correction = checkerResult.corrections[i];
                spare.copyUTF8Bytes(correction.join(SEPARATOR, byteSpare, null, null));
                Text phrase = new StringText(spare.toString());
                Text highlighted = null;
                if (suggestion.getPreTag() != null) {
                    spare.copyUTF8Bytes(correction.join(SEPARATOR, byteSpare, suggestion.getPreTag(), suggestion.getPostTag()));
                    highlighted = new StringText(spare.toString());
                }
                if (collateEnabled && collatePrune) {
                    resultEntry.addOption(new Suggestion.Entry.Option(phrase, highlighted, (float) (correction.score), collateMatch));
                } else {
                    resultEntry.addOption(new Suggestion.Entry.Option(phrase, highlighted, (float) (correction.score)));
View Full Code Here

Examples of org.elasticsearch.common.text.StringText

        return response;
    }

    private PhraseSuggestion.Entry buildResultEntry(PhraseSuggestionContext suggestion, CharsRefBuilder spare, double cutoffScore) {
        spare.copyUTF8Bytes(suggestion.getText());
        return new PhraseSuggestion.Entry(new StringText(spare.toString()), 0, spare.length(), cutoffScore);
    }
View Full Code Here

Examples of org.elasticsearch.common.text.StringText

            return GeoHashUtils.toString(geohashAsLong);
        }

        @Override
        public Text getKeyAsText() {
            return new StringText(getKey());
        }
View Full Code Here

Examples of org.elasticsearch.common.text.StringText

            } catch (Throwable t) {
                if (TransportActions.isShardNotAvailableException(t)) {
                    throw (ElasticsearchException) t;
                } else {
                    logger.debug("{} failed to multi percolate", t, request.shardId());
                    responseItem = new Response.Item(slot, new StringText(ExceptionsHelper.detailedMessage(t)));
                }
            }
            response.items.add(responseItem);
        }
        return response;
View Full Code Here

Examples of org.elasticsearch.common.text.StringText

        Map<String, SearchHitField> fields = new HashMap<>();
        for (IndexableField field : parsedDocument.rootDoc().getFields()) {
            fields.put(field.name(), new InternalSearchHitField(field.name(), ImmutableList.of()));
        }
        hitContext().reset(
                new InternalSearchHit(0, "unknown", new StringText(parsedDocument.type()), fields),
                atomicReaderContext, 0, indexReader
        );
    }
View Full Code Here

Examples of org.sonar.plugins.core.issue.tracking.StringText

  private final HashedSequence<StringText> b;
  private final HashedSequenceComparator<StringText> cmp;

  @VisibleForTesting
  public IssueTrackingBlocksRecognizer(String referenceSource, String source) {
    this.a = HashedSequence.wrap(new StringText(referenceSource), StringTextComparator.IGNORE_WHITESPACE);
    this.b = HashedSequence.wrap(new StringText(source), StringTextComparator.IGNORE_WHITESPACE);
    this.cmp = new HashedSequenceComparator<StringText>(StringTextComparator.IGNORE_WHITESPACE);
  }
View Full Code Here

Examples of org.sonar.plugins.core.issue.tracking.StringText

    this.lastSnapshots = lastSnapshots;
    this.resource = resource;
  }

  private void initHashes() {
    hashedReference = HashedSequence.wrap(new StringText(getReferenceSource()), StringTextComparator.IGNORE_WHITESPACE);
    hashedSource = HashedSequence.wrap(new StringText(getSource()), StringTextComparator.IGNORE_WHITESPACE);
  }
View Full Code Here

Examples of org.sonar.plugins.core.issue.tracking.StringText

public class StringTextTest {

  @Test
  public void testEmpty() {
    StringText r = new StringText("");
    assertThat(r.length()).isEqualTo(0);
  }
View Full Code Here

Examples of org.sonar.plugins.core.issue.tracking.StringText

    assertThat(r.length()).isEqualTo(0);
  }

  @Test
  public void testTwoLines() {
    StringText r = new StringText("a\nb");
    assertThat(r.length()).isEqualTo(2);
  }
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.