/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { String } from "../../types/java/lang/String"; import type { Parser } from "../../types/senselogic/sitevision/api/search/searcher/component/Parser"; import type { Builder } from "../../types/senselogic/sitevision/api/base/Builder"; /** *

* Builder for creating a multi-field {@link senselogic.sitevision.api.search.searcher.component.Parser} component with specific behaviour. *

* *

* ExtendedDismaxParserBuilder has several optional attributes: *

* * *

* Using the ExtendedDismaxParserBuilder is pretty straightforward, if you remember that it is stateful. * Conceptually you would typically use it like this: *

*
    *
  1. Get the ExtendedDismaxParserBuilder
  2. *
  3. Possibly add a query field
  4. *
  5. Possibly add another query field
  6. *
  7. ...
  8. *
  9. Do build
  10. *
*

* When you have built a Parser instance, you can re-use the ExtendedDismaxParserBuilder to build more instances. Typically like: *

*
    *
  1. Clear the query fields
  2. *
  3. Possibly add a query field
  4. *
  5. Possibly add another query field
  6. *
  7. ...
  8. *
  9. Do build
  10. *
*

* Example of how this strategy could be implemented in Velocity: *

*

 *    ## Get the builder
 *    #set ($searchFactory = $sitevisionUtils.searchFactory)
 *    #set ($edismaxBuilder = $searchFactory.extendedDismaxParserBuilder)
 *
 *    ## Create a Parser
 *    #set ($nameFieldParser = $edismaxBuilder.addQueryField('name.analyzed').build())
 *
 *    ## Re-use the builder to create another Parser
 *    #set ($nameAndTitleFieldParser = $edismaxBuilder.addQueryField('title.analyzed').build())
 *
 *    ## Re-use the builder to create yet another Parser
 *    #set ($titleAndContentFieldParser = $edismaxBuilder.clearQueryFields().addQueryField('title.analyzed').addQueryField('content.analyzed').build())
 *  
* *

* Tip! The {@link senselogic.sitevision.api.base.Builder Builder interface documentation} contains * more information about Builders and how to work with them! *

* *

* Solr note: the defType param for this parser is 'edismax' *

* *

* An instance of the Sitevision class implementing this interface can be obtained via * {@link senselogic.sitevision.api.search.SearchFactory#getExtendedDismaxParserBuilder()}. * See {@link senselogic.sitevision.api.search.SearchFactory} for how to obtain an instance of the SearchFactory interface. *

* @author Magnus Lövgren * @since Sitevision 3.6 */ export interface ExtendedDismaxParserBuilder extends Builder { /** * Adds a query field. * *

* Solr note: this is the 'qf' param. *

* @param aQueryField the name of the query field, a null or whitespace-only value will be ignored * @return this builder */ addQueryField(aQueryField: String | string): ExtendedDismaxParserBuilder; /** * Adds a query field with a specific boost. * *

* Solr note: this is the 'qf' param. *

* @param aQueryField the name of the query field, a null or whitespace-only value will be ignored * @param aBoostValue the boost value, a negative value will be ignored * @return this builder */ addQueryField( aQueryField: String | string, aBoostValue: number ): ExtendedDismaxParserBuilder; /** * Removes all currently specified query fields. * @return this builder */ clearQueryFields(): ExtendedDismaxParserBuilder; /** * Sets the tiebreaker. * *

* Solr note: this is the 'tie' param. The value should typically be something much less than 1. *

* @param aTieBreaker the tiebreaker * @return this builder * @since Sitevision 4.0.2 */ setTieBreaker(aTieBreaker: number): ExtendedDismaxParserBuilder; /** * Sets the user fields. * *

* Solr note: this is the 'uf' param. *

* @param aUserFields the user fields * @return this builder * @since Sitevision 4.0.2 */ setUserFields(aUserFields: String | string): ExtendedDismaxParserBuilder; /** * Sets the minimum should match. * *

* Solr note: this is the 'mm' param. A value of 100% corresponds to the AND operator and a value of 0% corresponds to th OR operator. *

* @param aMinimumShouldMatch the minimum should match * @return this builder * @since Sitevision 4.0.2 */ setMinimumShouldMatch( aMinimumShouldMatch: String | string ): ExtendedDismaxParserBuilder; /** * Adds a phrase field. * *

* Solr note: this is the 'pf' param. *

* @param aPhraseField a phrase field, a null or whitespace-only value will be ignored * @return this builder * @since Sitevision 4.0.2 */ addPhraseField(aPhraseField: String | string): ExtendedDismaxParserBuilder; /** * Removes all currently specified phrase fields. * @return this builder * @since Sitevision 4.0.2 */ clearPhraseFields(): ExtendedDismaxParserBuilder; /** * Sets a boost query. * *

* Solr note: this is the 'bq' param. *

* @param aBoostQuery the boost query * @return this builder * @since Sitevision 4.0.2 */ setBoostQuery(aBoostQuery: String | string): ExtendedDismaxParserBuilder; /** * Adds an additive boost function. * *

* Solr note: this is the 'bf' param. *

* @param aAdditiveBoostFunction an additive boost function, a null or whitespace-only value will be ignored * @return this builder * @since Sitevision 4.0.2 */ addAdditiveBoostFunction( aAdditiveBoostFunction: String | string ): ExtendedDismaxParserBuilder; /** * Removes all currently specified additive boost functions. * @return this builder * @since Sitevision 4.0.2 */ clearAdditiveBoostFunctions(): ExtendedDismaxParserBuilder; /** * Adds a a multiplicative boost function. * *

* Solr note: this is the 'boost' param. *

* @param aMultiplicativeBoostFunction a multiplicative boost function, a null or whitespace-only value will be ignored * @return this builder * @since Sitevision 4.0.2 */ addMultiplicativeBoostFunction( aMultiplicativeBoostFunction: String | string ): ExtendedDismaxParserBuilder; /** * Removes all currently specified multiplicative boost functions. * @return this builder * @since Sitevision 4.0.2 */ clearMultiplicativeBoostFunctions(): ExtendedDismaxParserBuilder; /** * Creates a Parser component instance using currently specified state/behaviour. * @return a parser component */ build(): Parser; } declare namespace ExtendedDismaxParserBuilder {} declare var extendedDismaxParserBuilder: ExtendedDismaxParserBuilder; export default extendedDismaxParserBuilder;