Package org.elasticsearch.common.trove.set.hash

Examples of org.elasticsearch.common.trove.set.hash.TIntHashSet


        }

        if (excluded == null || excluded.isEmpty()) {
            this.excluded = null;
        } else {
            this.excluded = new TIntHashSet(excluded.size());
            for (String s : excluded) {
                this.excluded.add(Integer.parseInt(s));
            }
        }
View Full Code Here


        public AggregatorValueProc(TIntIntHashMap facets, Set<String> excluded, SearchScript script) {
            super(facets);
            if (excluded == null || excluded.isEmpty()) {
                this.excluded = null;
            } else {
                this.excluded = new TIntHashSet(excluded.size());
                for (String s : excluded) {
                    this.excluded.add(Integer.parseInt(s));
                }
            }
            this.script = script;
View Full Code Here

      indexWriter.addDocument(DocumentBuilder.doc()
              .add(DocumentBuilder.field("mvalue", "aaa")).build());

      IndexReader reader = IndexReader.open(indexWriter, true);

      TIntHashSet excludeTerms = new TIntHashSet();
      excludeTerms.add(HashedStringFieldType.hashCode("xxx"));

      Pattern excludePattern = Pattern.compile("\\d{3}|a"); // the a is to test full token matching

      HashedStringFieldType type = new HashedStringFieldType(
              new HashedStringFieldData.HashedStringTypeLoader(0,0, excludePattern,excludeTerms));
View Full Code Here

      HashedStringsFacetCollector.OUTPUT_MODE output_mode = null;




      TIntHashSet excluded = new TIntHashSet();
      TIntHashSet included = new TIntHashSet();
      TermsFacet.ComparatorType comparatorType = TermsFacet.ComparatorType.COUNT;

      String currentFieldName = null;
      XContentParser.Token token;
      while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
         if (token == XContentParser.Token.FIELD_NAME) {
            currentFieldName = parser.currentName();
         } else if (token == XContentParser.Token.START_ARRAY) {
            if ("exclude".equals(currentFieldName)) {
               while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
                  if (token == XContentParser.Token.VALUE_NUMBER) {
                     excluded.add(parser.intValue());
                  } else
                     excluded.add(HashedStringFieldType.hashCode(parser.text()));
               }

            }
            else if ("include".equals(currentFieldName)) {
               while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
                  if (token == XContentParser.Token.VALUE_NUMBER) {
                     included.add(parser.intValue());
                  } else
                     included.add(HashedStringFieldType.hashCode(parser.text()));
               }
            }
         } else if (token.isValue()) {
            if ("field".equals(currentFieldName)) {
               field = parser.text();
View Full Code Here

         FieldSettings s = new FieldSettings();
         s.max_terms_per_doc = fieldEntry.getValue().getAsInt("max_terms_per_doc",0);
         s.min_docs_per_term = fieldEntry.getValue().getAsInt("min_docs_per_term",0);
         String[] excludeTerms = fieldEntry.getValue().getAsArray("exclude",new String[] {});
         if (excludeTerms.length != 0) {
            TIntHashSet excludeSet = new TIntHashSet(excludeTerms.length);
            for (String t: excludeTerms)
               excludeSet.add(HashedStringFieldType.hashCode(t));
            s.excludeTerms = excludeSet;
         }

         String excludePattern = fieldEntry.getValue().get("exclude_regex");
         if (excludePattern!=null && !excludePattern.isEmpty()) {
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.trove.set.hash.TIntHashSet

Copyright © 2018 www.massapicom. 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.