Package org.apache.solr.search.facet
Class RelatednessAgg
java.lang.Object
org.apache.lucene.queries.function.ValueSource
org.apache.solr.search.facet.AggValueSource
org.apache.solr.search.facet.RelatednessAgg
An aggregation function designed to be nested under other (possibly deeply nested) facets for the
purposes of computing the "relatedness" of facet buckets relative to "foreground" and
"background" sets -- primarily for the purpose of building "Semantic Knowledge Graphs"
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.lucene.search.Queryprotected final org.apache.lucene.search.Queryprotected doublestatic final Stringstatic final StringFields inherited from class org.apache.solr.search.facet.AggValueSource
name -
Constructor Summary
ConstructorsConstructorDescriptionRelatednessAgg(org.apache.lucene.search.Query fgQ, org.apache.lucene.search.Query bgQ) -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecomputeRelatedness(long fg_count, long fg_size, long bg_count, long bg_size) This is an aproximated Z-Score, as described in the "Scoring Semantic Relationships" section of "The Semantic Knowledge Graph: A compact, auto-generated model for real-time traversal and ranking of any relationship within a domain"createFacetMerger(Object prototype) createSlotAcc(FacetContext fcontext, long numDocs, int numSlots) booleanorg.apache.lucene.queries.function.FunctionValuesinthashCode()static doubleroundTo5Digits(double val) Helper function for rounding/truncating relatedness & popularity values to 5 decimal digits, since these values are all probabilistic more then 5 digits aren't really relevant and may give a missleading impression of added precision.voidMethods inherited from class org.apache.solr.search.facet.AggValueSource
getChildren, nameMethods inherited from class org.apache.lucene.queries.function.ValueSource
asDoubleValuesSource, asLongValuesSource, createWeight, fromDoubleValuesSource, getSortField, newContext, toString
-
Field Details
-
SWEEP_COLLECTION
- See Also:
-
fgQ
protected final org.apache.lucene.search.Query fgQ -
bgQ
protected final org.apache.lucene.search.Query bgQ -
min_pop
protected double min_pop -
NAME
- See Also:
-
-
Constructor Details
-
RelatednessAgg
public RelatednessAgg(org.apache.lucene.search.Query fgQ, org.apache.lucene.search.Query bgQ)
-
-
Method Details
-
setOpts
-
description
- Specified by:
descriptionin classorg.apache.lucene.queries.function.ValueSource
-
equals
- Overrides:
equalsin classAggValueSource
-
hashCode
public int hashCode()- Specified by:
hashCodein classorg.apache.lucene.queries.function.ValueSource
-
getValues
public org.apache.lucene.queries.function.FunctionValues getValues(Map<Object, Object> context, org.apache.lucene.index.LeafReaderContext readerContext) throws IOException- Overrides:
getValuesin classAggValueSource- Throws:
IOException
-
createSlotAcc
- Overrides:
createSlotAccin classAggValueSource- Throws:
IOException
-
createFacetMerger
- Specified by:
createFacetMergerin classAggValueSource
-
computeRelatedness
public static double computeRelatedness(long fg_count, long fg_size, long bg_count, long bg_size) This is an aproximated Z-Score, as described in the "Scoring Semantic Relationships" section of "The Semantic Knowledge Graph: A compact, auto-generated model for real-time traversal and ranking of any relationship within a domain"See Also:
-
roundTo5Digits
public static double roundTo5Digits(double val) Helper function for rounding/truncating relatedness & popularity values to 5 decimal digits, since these values are all probabilistic more then 5 digits aren't really relevant and may give a missleading impression of added precision.
-