Search.properties - Axiom

The search.properties configuration file contains a set ofsearch profiles. A search profile encapsulates a set of behavior and parameters for searches via the Axiom query API.

Definition

profile_name

As in other Axiom properties files, we declare the profile with a line that's simply the name of the profile.

profile_name.fields = { field1: 5, field2: 3, field3: 1}

Next, we can declare a set of default fields to match against when this profile is used. The value of the property here is a JSON object whose property names are the fields to search against. The value of each property is the weight that will be applied to that field when sorting results by relevance.

profile_name.analyzer = AnalyzerClassName

By default, Axiom uses Lucene's StandardAnalyzer when querying. You can specify a different or custom analyzer by using its Java class name here.

Usage

app.getHits("MyPrototype", new NativeFilter("varmints", "profile_name"));

Using the above search profile, this expression will search for MyPrototype objects using the term "varmints" in field1, field2, and field3. In terms of revelance, field1 will be weighted by 5, field2 by 3, and field3 normally.