github.com/altipla-consulting/ravendb-go-client@v0.1.3/more_like_this_options.go (about) 1 package ravendb 2 3 import "math" 4 5 const ( 6 MoreLikeThisOptionsDefaultMaximumNumberOfTokensParsed = 5000 7 MoreLikeThisOptionsDefaultMinimumTermFrequency = 2 8 MoreLikeThisOptionsDefaultMinimumDocumentFrequency = 5 9 MoreLikeThisOptionsDefaultMaximumDocumentFrequence = math.MaxInt32 10 MoreLikeThisOptionsDefaultBoost = false 11 MoreLikeThisOptionsDefaultBoostFactor = 1 12 MoreLikeThisOptionsDefaultMinimumWordLength = 0 13 MoreLikeThisOptionsDefaultMaximumWordLength = 0 14 MoreLikeThisOptionsDefaultMaximumQueryTerms = 25 15 ) 16 17 var ( 18 defaultMoreLikeThisOptions = &MoreLikeThisOptions{} 19 ) 20 21 type MoreLikeThisOptions struct { 22 MinimumTermFrequency *int `json:"MinimumTermFrequency"` 23 MaximumQueryTerms *int `json:"MaximumQueryTerms"` 24 MaximumNumberOfTokensParsed *int `json:"MaximumNumberOfTokensParsed"` 25 MinimumWordLength *int `json:"MinimumWordLength"` 26 MaximumWordLength *int `json:"MaximumWordLength"` 27 MinimumDocumentFrequency *int `json:"MinimumDocumentFrequency"` 28 MaximumDocumentFrequency *int `json:"MaximumDocumentFrequency"` 29 MaximumDocumentFrequencyPercentage *int `json:"MaximumDocumentFrequencyPercentage"` 30 Boost *bool `json:"Boost"` 31 BoostFactor *float32 `json:"BoostFactor"` 32 StopWordsDocumentID *string `json:"StopWordsDocumentId"` 33 Fields []string `json:"Fields"` 34 } 35 36 func NewMoreLikeThisOptions() *MoreLikeThisOptions { 37 return &MoreLikeThisOptions{} 38 } 39 40 func (o *MoreLikeThisOptions) SetMinimumTermFrequency(minimumTermFrequency int) { 41 o.MinimumTermFrequency = &minimumTermFrequency 42 } 43 44 func (o *MoreLikeThisOptions) SetMaximumQueryTerms(maximumQueryTerms int) { 45 o.MaximumQueryTerms = &maximumQueryTerms 46 } 47 48 func (o *MoreLikeThisOptions) SetMaximumNumberOfTokensParsed(maximumNumberOfTokensParsed int) { 49 o.MaximumNumberOfTokensParsed = &maximumNumberOfTokensParsed 50 } 51 52 func (o *MoreLikeThisOptions) SetMinimumWordLength(minimumWordLength int) { 53 o.MinimumWordLength = &minimumWordLength 54 } 55 56 func (o *MoreLikeThisOptions) SetMaximumWordLength(maximumWordLength int) { 57 o.MaximumWordLength = &maximumWordLength 58 } 59 60 func (o *MoreLikeThisOptions) SetMinimumDocumentFrequency(minimumDocumentFrequency int) { 61 o.MinimumDocumentFrequency = &minimumDocumentFrequency 62 } 63 64 func (o *MoreLikeThisOptions) SetMaximumDocumentFrequency(maximumDocumentFrequency int) { 65 o.MaximumDocumentFrequency = &maximumDocumentFrequency 66 } 67 68 func (o *MoreLikeThisOptions) SetMaximumDocumentFrequencyPercentage(maximumDocumentFrequencyPercentage int) { 69 o.MaximumDocumentFrequencyPercentage = &maximumDocumentFrequencyPercentage 70 } 71 72 func (o *MoreLikeThisOptions) SetBoost(boost bool) { 73 o.Boost = &boost 74 } 75 76 func (o *MoreLikeThisOptions) SetBoostFactor(boostFactor float32) { 77 o.BoostFactor = &boostFactor 78 } 79 80 func (o *MoreLikeThisOptions) SetStopWordsDocumentID(stopWordsDocumentID string) { 81 o.StopWordsDocumentID = &stopWordsDocumentID 82 }