Interface ScoredTextFieldOperation<T>

  • Type Parameters:
    T -

    public interface ScoredTextFieldOperation<T>
    Scored text field operations allows to build Google like queries.
    Since:
    6.5
    See Also:
    Query
    API:
    This is a public API.
    • Method Detail

      • query

        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.

        Example:

         import workflow.business.data.Dossier;
         
         List<Dossier> result = ivy.repo.search(Dossier.class)
              .score().allTextFields().query("Axon+Ivy~1") 
              .limit(50)
              .execute()
              .getAll();
         
        This will return all dossiers that contain the words Axon and Ivy but also dossiers where Ivy is not spelled correct (e.g. Ivi, Ify, etc).

        Query Syntax:

        By default at least one of the given words in the query string must be available (OR operation). E.g Axon Ivy means Axon or Ivy has 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:

        OperatorDescriptionExampleMatches
        +The value should contain the word.+Axon +Ivy"Hello Axon and Ivy"
        |Or operation. The value should contain at least one of the words.Axon | Ivy"Hello Axon and Ivy", "Hello Axon", "Ivy is great"
        -Not operation. Negates the following expression.-Ivy"Hello Axon"
        ""The value should contain all words in the quotes and they should stand adjacent."Axon Ivy""Hello Axon Ivy. How are you"
        *The value should contain a word that starts with the given prefix.Ax*"Axon.ivy", "This is an axiom"
        ()Defines precedence.+Axon +(Ivy | Vibe)"Axon.ivy", "Axon Vibe"
        ~NThe value should contain the word. Also misspelled words are matched.
        The number defines how many characters can be misspelled.
        Ivy~1"Axon.ify"
        ~NDefines the distance the given words in the phrase can be separate from each other."Axon Ivy"~2"Hello Axon and Ivy. How are you"

        Parameters:
        query - the query string
        Returns:
        limit, orderBy or execute operations
        Since:
        6.5
        API:
        This public API is available in IvyScript and Java. It has the visibility ADVANCED.