Interface RSearchReactive


public interface RSearchReactive
Reactive API for RediSearch module
Author:
Nikita Koksharov
  • Method Details

    • createIndex

      reactor.core.publisher.Mono<Void> createIndex(String indexName, IndexOptions options, FieldIndex... fields)
      Creates an index.

      Code example:

                   search.create("idx", IndexOptions.defaults()
                                           .on(IndexType.HASH)
                                           .prefix(Arrays.asList("doc:")),
                                           FieldIndex.text("t1"),
                                           FieldIndex.tag("t2").withSuffixTrie());
       
      Parameters:
      indexName - index name
      options - index options
      fields - fields
    • search

      reactor.core.publisher.Mono<SearchResult> search(String indexName, String query, QueryOptions options)
      Executes search over defined index using defined query.

      Code example:

       SearchResult r = s.search("idx", "*", QueryOptions.defaults()
                                                         .returnAttributes(new ReturnAttribute("t1"), new ReturnAttribute("t2")));
       
      Parameters:
      indexName - index name
      query - query value
      options - query options
      Returns:
      search result
    • aggregate

      reactor.core.publisher.Mono<AggregationResult> aggregate(String indexName, String query, AggregationOptions options)
      Executes aggregation over defined index using defined query.

      Code example:

       AggregationResult r = s.aggregate("idx", "*", AggregationOptions.defaults()
                                                                       .load("t1", "t2"));
       
      Parameters:
      indexName - index name
      query - query value
      options - aggregation options
      Returns:
      aggregation result
    • addAlias

      reactor.core.publisher.Mono<Void> addAlias(String alias, String indexName)
      Adds alias to defined index name
      Parameters:
      alias - alias value
      indexName - index name
    • delAlias

      reactor.core.publisher.Mono<Void> delAlias(String alias)
      Deletes index alias
      Parameters:
      alias - alias value
    • updateAlias

      reactor.core.publisher.Mono<Void> updateAlias(String alias, String indexName)
      Adds alias to defined index name. Re-assigns the alias if it was used before with a different index.
      Parameters:
      alias - alias value
      indexName - index name
    • alter

      reactor.core.publisher.Mono<Void> alter(String indexName, boolean skipInitialScan, FieldIndex... fields)
      Adds a new attribute to the index
      Parameters:
      indexName - index name
      skipInitialScan - doesn't scan the index if true
      fields - field indexes
    • getConfig

      reactor.core.publisher.Mono<Map<String,String>> getConfig(String parameter)
      Returns configuration map by defined parameter name
      Parameters:
      parameter - parameter name
      Returns:
      configuration map
    • setConfig

      reactor.core.publisher.Mono<Void> setConfig(String parameter, String value)
      Sets configuration value by the parameter name
      Parameters:
      parameter - parameter name
      value - parameter value
    • delCursor

      reactor.core.publisher.Mono<Void> delCursor(String indexName, long cursorId)
      Deletes cursor by index name and id
      Parameters:
      indexName - index name
      cursorId - cursor id
    • readCursor

      reactor.core.publisher.Mono<AggregationResult> readCursor(String indexName, long cursorId)
      Returns next results by index name and cursor id
      Parameters:
      indexName - index name
      cursorId - cursor id
      Returns:
      aggregation result
    • readCursor

      reactor.core.publisher.Mono<AggregationResult> readCursor(String indexName, long cursorId, int count)
      Returns next results by index name, cursor id and results size
      Parameters:
      indexName - index name
      cursorId - cursor id
      count - results size
      Returns:
      aggregation result
    • addDict

      reactor.core.publisher.Mono<Long> addDict(String dictionary, String... terms)
      Adds defined terms to the dictionary
      Parameters:
      dictionary - dictionary name
      terms - terms
      Returns:
      number of new terms
    • delDict

      reactor.core.publisher.Mono<Long> delDict(String dictionary, String... terms)
      Deletes defined terms from the dictionary
      Parameters:
      dictionary - dictionary name
      terms - terms
      Returns:
      number of deleted terms
    • dumpDict

      reactor.core.publisher.Mono<List<String>> dumpDict(String dictionary)
      Returns terms stored in the dictionary
      Parameters:
      dictionary - dictionary name
      Returns:
      terms
    • dropIndex

      reactor.core.publisher.Mono<Void> dropIndex(String indexName)
      Deletes index by name
      Parameters:
      indexName - index name
    • dropIndexAndDocuments

      reactor.core.publisher.Mono<Void> dropIndexAndDocuments(String indexName)
      Deletes index by name and associated documents
      Parameters:
      indexName - index name
    • info

      reactor.core.publisher.Mono<IndexInfo> info(String indexName)
      Returns index info by name
      Parameters:
      indexName - index name
      Returns:
      index info
    • spellcheck

      reactor.core.publisher.Mono<Map<String,Map<String,Double>>> spellcheck(String indexName, String query, SpellcheckOptions options)
      Executes spell checking by defined index name and query.
       Mapinvalid input: '<'String, Mapinvalid input: '<'String, Double>> res = s.spellcheck("idx", "Hocke sti", SpellcheckOptions.defaults()
                                                                                                .includedTerms("name"));
       
      Parameters:
      indexName - index name
      query - query
      options - spell checking options
      Returns:
      result
    • dumpSynonyms

      reactor.core.publisher.Mono<Map<String,List<String>>> dumpSynonyms(String indexName)
      Returns synonyms mapped by word by defined index name
      Parameters:
      indexName - index name
      Returns:
      synonyms map
    • updateSynonyms

      reactor.core.publisher.Mono<Void> updateSynonyms(String indexName, String synonymGroupId, String... terms)
      Updates synonyms
      Parameters:
      indexName - index name
      synonymGroupId - synonym group id
      terms - terms