- Type Parameters:
public interface ScoredTextFieldOperation<T>Scored text field operations allows to build Google like queries.
- See Also:
- This is a public API.
ScoredFilter<T> query(String query)
Allows to build Google like searches. The returned result hits are by default ordered by score (best fit first). Note, some result may not match the complete query string but may also be relevant.
This will return all dossiers that contain the words
import workflow.business.data.Dossier; List<Dossier> result = ivy.repo.search(Dossier.class) .score().allTextFields().query("Axon+Ivy~1") .limit(50) .execute() .getAll();
Ivybut also dossiers where
Ivyis not spelled correct (e.g.
By default at least one of the given words in the query string must be available (OR operation). E.g
Ivyhas to be in the business data value. The value that contains all words are scored higher than the value that misses one of the words.
You can use the following operators inside the query string:
Operator Description Example Matches + The value should contain the word.
"Hello Axon and Ivy"
| Or operation. The value should contain at least one of the words.
Axon | Ivy
"Hello Axon and Ivy",
"Ivy is great"
- Not operation. Negates the following expression.
"" The value should contain all words in the quotes and they should stand adjacent.
"Hello Axon Ivy. How are you"
* The value should contain a word that starts with the given prefix.
"This is an axiom"
() Defines precedence.
+Axon +(Ivy | Vibe)
~N The value should contain the word. Also misspelled words are matched.
The number defines how many characters can be misspelled.
~N Defines the distance the given words in the phrase can be separate from each other.
"Hello Axon and Ivy. How are you"
query- the query string
- limit, orderBy or execute operations
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.