public void enableFacetProcessing() { if ( facetConfig == null ) { facetConfig = new FacetsConfig(); } }
public void enableFacetProcessing() { if ( facetConfig == null ) { facetConfig = new FacetsConfig(); } }
private FacetsConfig getConfig() { return new FacetsConfig(); }
private FacetsConfig getFacetsConfigurations(Map<String, ColumnDefinition> indices) { FacetsConfig config = new FacetsConfig(); for (Map.Entry<String, ColumnDefinition> entry : indices.entrySet()) { if (entry.getValue().isFacet()) { String indexField = entry.getKey(); config.setHierarchical(indexField, true); config.setMultiValued(indexField, true); } } return config; }
private void loadSegment(int segmentNumber) throws Exception { indexLock.writeLock().lock(); try { if (!segmentMap.containsKey(segmentNumber)) { String lockName = indexName + "-" + segmentNumber; ILock hzLock = hazelcastManager.getLock(lockName); hazelLockMap.put(segmentNumber, hzLock); log.info("Waiting for lock for index <" + indexName + "> segment <" + segmentNumber + ">"); hzLock.lock(); log.info("Obtained lock for index <" + indexName + "> segment <" + segmentNumber + ">"); //Just for clarity IndexSegmentInterface indexSegmentInterface = this; //doesnt need to be done each time and it is done in StartNode but helps with test cases that take different paths FacetsConfig.DEFAULT_DIM_CONFIG.multiValued = true; facetsConfig = new FacetsConfig(); LumongoSegment s = new LumongoSegment(segmentNumber, indexSegmentInterface, indexConfig, facetsConfig, documentStorage); segmentMap.put(segmentNumber, s); log.info("Loaded segment <" + segmentNumber + "> for index <" + indexName + ">"); log.info("Current segments <" + (new TreeSet<>(segmentMap.keySet())) + "> for index <" + indexName + ">"); } } finally { indexLock.writeLock().unlock(); } }
facetsConfig = new FacetsConfig();
private Document generateIndexDoc(Record record, Map<String, ColumnDefinition> columns, TaxonomyWriter taxonomyWriter) throws AnalyticsIndexException, IOException { Document doc = new Document(); FacetsConfig config = new FacetsConfig(); FieldType numericFieldType = getLuceneNumericFieldType(FieldType.NumericType.LONG); doc.add(new StringField(INDEX_ID_INTERNAL_FIELD, record.getId(), Store.YES)); doc.add(new LongField(INDEX_INTERNAL_TIMESTAMP_FIELD, record.getTimestamp(), numericFieldType)); /* make the best effort to store in the given timestamp, or else, * fall back to a compatible format, or else, lastly, string */ String name; for (Map.Entry<String, ColumnDefinition> entry : columns.entrySet()) { name = entry.getKey(); this.checkAndAddDocEntry(doc, entry.getValue().getType(), name, record.getValue(name)); if (entry.getValue().isFacet()) { this.checkAndAddTaxonomyDocEntries(doc, name, record, config); } } return config.build(taxonomyWriter, doc); }
/** Empty constructor */ public AssociationsFacetsExample() { config = new FacetsConfig(); config.setMultiValued("tags", true); config.setIndexFieldName("tags", "$tags"); config.setMultiValued("genre", true); config.setIndexFieldName("genre", "$genre"); }
@Override public void setup() throws Exception { super.setup(); if (config == null) { boolean withFacets = getRunData().getConfig().get("with.facets", true); if (withFacets) { FacetSource facetsSource = getRunData().getFacetSource(); config = new FacetsConfig(); facetsSource.configure(config); } } }