Skip to content

Commit

Permalink
Implemented string filter comparators
Browse files Browse the repository at this point in the history
  • Loading branch information
nick committed Apr 18, 2024
1 parent c199270 commit 2ce6dc0
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 52 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ docs/PercolateRequest.md
docs/PercolateRequestQuery.md
docs/QueryFilter.md
docs/RangeFilter.md
docs/RangeFilterLte.md
docs/SearchApi.md
docs/SearchRequest.md
docs/SearchRequestKnn.md
Expand Down Expand Up @@ -89,6 +90,7 @@ src/model/PercolateRequest.js
src/model/PercolateRequestQuery.js
src/model/QueryFilter.js
src/model/RangeFilter.js
src/model/RangeFilterLte.js
src/model/SearchRequest.js
src/model/SearchRequestKnn.js
src/model/SearchResponse.js
Expand Down Expand Up @@ -135,6 +137,7 @@ test/model/PercolateRequest.spec.js
test/model/PercolateRequestQuery.spec.js
test/model/QueryFilter.spec.js
test/model/RangeFilter.spec.js
test/model/RangeFilterLte.spec.js
test/model/SearchRequest.spec.js
test/model/SearchRequestKnn.spec.js
test/model/SearchResponse.spec.js
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ Class | Method | HTTP request | Description
- [Manticoresearch.PercolateRequestQuery](docs/PercolateRequestQuery.md)
- [Manticoresearch.QueryFilter](docs/QueryFilter.md)
- [Manticoresearch.RangeFilter](docs/RangeFilter.md)
- [Manticoresearch.RangeFilterLte](docs/RangeFilterLte.md)
- [Manticoresearch.ReplaceDocumentRequest](docs/ReplaceDocumentRequest.md)
- [Manticoresearch.SearchRequest](docs/SearchRequest.md)
- [Manticoresearch.SearchRequestKnn](docs/SearchRequestKnn.md)
Expand Down
8 changes: 4 additions & 4 deletions docs/RangeFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**field** | **String** | |
**lte** | **Number** | | [optional]
**gte** | **Number** | | [optional]
**lt** | **Number** | | [optional]
**gt** | **Number** | | [optional]
**lte** | [**RangeFilterLte**](RangeFilterLte.md) | | [optional]
**gte** | [**RangeFilterLte**](RangeFilterLte.md) | | [optional]
**lt** | [**RangeFilterLte**](RangeFilterLte.md) | | [optional]
**gt** | [**RangeFilterLte**](RangeFilterLte.md) | | [optional]

[[Using in search requests]](SearchRequest.md#RangeFilter)

Expand Down
10 changes: 10 additions & 0 deletions docs/RangeFilterLte.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Manticoresearch.RangeFilterLte

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------




6 changes: 3 additions & 3 deletions docs/SearchRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ async function(){
var searchRequest = manticoresearch.model.SearchRequest();
searchRequest.index = "movies";

var rangeFilter = new Manticoresearch.RangeFilter('year');
Manticoresearch.RangeFilter.constructFromObject({lte: 2002}, rangeFilter);
Manticoresearch.RangeFilter.constructFromObject({gte: 1000}, rangeFilter);
var rangeFilter = new Manticoresearch.RangeFilter('_year');
rangeFilter.lte = 2002
rangeFilter.gte = 1000
searchRequest.attr_filter = rangeFilter;

async function(){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manticoresearch-dev",
"version": "4.1.1",
"version": "4.2.0",
"description": "Javascript client for Manticore Search",
"license": "MIT",
"main": "src/index.js",
Expand Down
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Aggregation', 'model/AggregationComposite', 'model/AggregationCompositeSourcesInnerValue', 'model/AggregationCompositeSourcesInnerValueTerms', 'model/AggregationSortInnerValue', 'model/AggregationTerms', 'model/BoolFilter', 'model/BulkResponse', 'model/DeleteDocumentRequest', 'model/DeleteResponse', 'model/EqualsFilter', 'model/ErrorResponse', 'model/Facet', 'model/FilterBoolean', 'model/FilterNumber', 'model/FilterString', 'model/GeoDistanceFilter', 'model/GeoDistanceFilterLocationAnchor', 'model/Highlight', 'model/HighlightField', 'model/InFilter', 'model/InsertDocumentRequest', 'model/KnnQueryByDocId', 'model/KnnQueryByVector', 'model/MatchFilter', 'model/MatchOp', 'model/MatchOpFilter', 'model/MatchPhraseFilter', 'model/NotFilterBoolean', 'model/NotFilterNumber', 'model/NotFilterString', 'model/PercolateRequest', 'model/PercolateRequestQuery', 'model/QueryFilter', 'model/RangeFilter', 'model/ReplaceDocumentRequest', 'model/SearchRequest', 'model/SearchRequestKnn', 'model/SearchResponse', 'model/SearchResponseHits', 'model/SortMVA', 'model/SortMultiple', 'model/SortOrder', 'model/SourceByRules', 'model/SuccessResponse', 'model/UpdateDocumentRequest', 'model/UpdateResponse', 'api/IndexApi', 'api/SearchApi', 'api/UtilsApi'], factory);
define(['ApiClient', 'model/Aggregation', 'model/AggregationComposite', 'model/AggregationCompositeSourcesInnerValue', 'model/AggregationCompositeSourcesInnerValueTerms', 'model/AggregationSortInnerValue', 'model/AggregationTerms', 'model/BoolFilter', 'model/BulkResponse', 'model/DeleteDocumentRequest', 'model/DeleteResponse', 'model/EqualsFilter', 'model/ErrorResponse', 'model/Facet', 'model/FilterBoolean', 'model/FilterNumber', 'model/FilterString', 'model/GeoDistanceFilter', 'model/GeoDistanceFilterLocationAnchor', 'model/Highlight', 'model/HighlightField', 'model/InFilter', 'model/InsertDocumentRequest', 'model/KnnQueryByDocId', 'model/KnnQueryByVector', 'model/MatchFilter', 'model/MatchOp', 'model/MatchOpFilter', 'model/MatchPhraseFilter', 'model/NotFilterBoolean', 'model/NotFilterNumber', 'model/NotFilterString', 'model/PercolateRequest', 'model/PercolateRequestQuery', 'model/QueryFilter', 'model/RangeFilter', 'model/RangeFilterLte', 'model/ReplaceDocumentRequest', 'model/SearchRequest', 'model/SearchRequestKnn', 'model/SearchResponse', 'model/SearchResponseHits', 'model/SortMVA', 'model/SortMultiple', 'model/SortOrder', 'model/SourceByRules', 'model/SuccessResponse', 'model/UpdateDocumentRequest', 'model/UpdateResponse', 'api/IndexApi', 'api/SearchApi', 'api/UtilsApi'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'), require('./model/Aggregation'), require('./model/AggregationComposite'), require('./model/AggregationCompositeSourcesInnerValue'), require('./model/AggregationCompositeSourcesInnerValueTerms'), require('./model/AggregationSortInnerValue'), require('./model/AggregationTerms'), require('./model/BoolFilter'), require('./model/BulkResponse'), require('./model/DeleteDocumentRequest'), require('./model/DeleteResponse'), require('./model/EqualsFilter'), require('./model/ErrorResponse'), require('./model/Facet'), require('./model/FilterBoolean'), require('./model/FilterNumber'), require('./model/FilterString'), require('./model/GeoDistanceFilter'), require('./model/GeoDistanceFilterLocationAnchor'), require('./model/Highlight'), require('./model/HighlightField'), require('./model/InFilter'), require('./model/InsertDocumentRequest'), require('./model/KnnQueryByDocId'), require('./model/KnnQueryByVector'), require('./model/MatchFilter'), require('./model/MatchOp'), require('./model/MatchOpFilter'), require('./model/MatchPhraseFilter'), require('./model/NotFilterBoolean'), require('./model/NotFilterNumber'), require('./model/NotFilterString'), require('./model/PercolateRequest'), require('./model/PercolateRequestQuery'), require('./model/QueryFilter'), require('./model/RangeFilter'), require('./model/ReplaceDocumentRequest'), require('./model/SearchRequest'), require('./model/SearchRequestKnn'), require('./model/SearchResponse'), require('./model/SearchResponseHits'), require('./model/SortMVA'), require('./model/SortMultiple'), require('./model/SortOrder'), require('./model/SourceByRules'), require('./model/SuccessResponse'), require('./model/UpdateDocumentRequest'), require('./model/UpdateResponse'), require('./api/IndexApi'), require('./api/SearchApi'), require('./api/UtilsApi'));
module.exports = factory(require('./ApiClient'), require('./model/Aggregation'), require('./model/AggregationComposite'), require('./model/AggregationCompositeSourcesInnerValue'), require('./model/AggregationCompositeSourcesInnerValueTerms'), require('./model/AggregationSortInnerValue'), require('./model/AggregationTerms'), require('./model/BoolFilter'), require('./model/BulkResponse'), require('./model/DeleteDocumentRequest'), require('./model/DeleteResponse'), require('./model/EqualsFilter'), require('./model/ErrorResponse'), require('./model/Facet'), require('./model/FilterBoolean'), require('./model/FilterNumber'), require('./model/FilterString'), require('./model/GeoDistanceFilter'), require('./model/GeoDistanceFilterLocationAnchor'), require('./model/Highlight'), require('./model/HighlightField'), require('./model/InFilter'), require('./model/InsertDocumentRequest'), require('./model/KnnQueryByDocId'), require('./model/KnnQueryByVector'), require('./model/MatchFilter'), require('./model/MatchOp'), require('./model/MatchOpFilter'), require('./model/MatchPhraseFilter'), require('./model/NotFilterBoolean'), require('./model/NotFilterNumber'), require('./model/NotFilterString'), require('./model/PercolateRequest'), require('./model/PercolateRequestQuery'), require('./model/QueryFilter'), require('./model/RangeFilter'), require('./model/RangeFilterLte'), require('./model/ReplaceDocumentRequest'), require('./model/SearchRequest'), require('./model/SearchRequestKnn'), require('./model/SearchResponse'), require('./model/SearchResponseHits'), require('./model/SortMVA'), require('./model/SortMultiple'), require('./model/SortOrder'), require('./model/SourceByRules'), require('./model/SuccessResponse'), require('./model/UpdateDocumentRequest'), require('./model/UpdateResponse'), require('./api/IndexApi'), require('./api/SearchApi'), require('./api/UtilsApi'));
}
}(function(ApiClient, Aggregation, AggregationComposite, AggregationCompositeSourcesInnerValue, AggregationCompositeSourcesInnerValueTerms, AggregationSortInnerValue, AggregationTerms, BoolFilter, BulkResponse, DeleteDocumentRequest, DeleteResponse, EqualsFilter, ErrorResponse, Facet, FilterBoolean, FilterNumber, FilterString, GeoDistanceFilter, GeoDistanceFilterLocationAnchor, Highlight, HighlightField, InFilter, InsertDocumentRequest, KnnQueryByDocId, KnnQueryByVector, MatchFilter, MatchOp, MatchOpFilter, MatchPhraseFilter, NotFilterBoolean, NotFilterNumber, NotFilterString, PercolateRequest, PercolateRequestQuery, QueryFilter, RangeFilter, ReplaceDocumentRequest, SearchRequest, SearchRequestKnn, SearchResponse, SearchResponseHits, SortMVA, SortMultiple, SortOrder, SourceByRules, SuccessResponse, UpdateDocumentRequest, UpdateResponse, IndexApi, SearchApi, UtilsApi) {
}(function(ApiClient, Aggregation, AggregationComposite, AggregationCompositeSourcesInnerValue, AggregationCompositeSourcesInnerValueTerms, AggregationSortInnerValue, AggregationTerms, BoolFilter, BulkResponse, DeleteDocumentRequest, DeleteResponse, EqualsFilter, ErrorResponse, Facet, FilterBoolean, FilterNumber, FilterString, GeoDistanceFilter, GeoDistanceFilterLocationAnchor, Highlight, HighlightField, InFilter, InsertDocumentRequest, KnnQueryByDocId, KnnQueryByVector, MatchFilter, MatchOp, MatchOpFilter, MatchPhraseFilter, NotFilterBoolean, NotFilterNumber, NotFilterString, PercolateRequest, PercolateRequestQuery, QueryFilter, RangeFilter, RangeFilterLte, ReplaceDocumentRequest, SearchRequest, SearchRequestKnn, SearchResponse, SearchResponseHits, SortMVA, SortMultiple, SortOrder, SourceByRules, SuccessResponse, UpdateDocumentRequest, UpdateResponse, IndexApi, SearchApi, UtilsApi) {
'use strict';

/**
Expand Down Expand Up @@ -228,6 +228,11 @@
* @property {module:model/RangeFilter}
*/
RangeFilter: RangeFilter,
/**
* The RangeFilterLte model constructor.
* @property {module:model/RangeFilterLte}
*/
RangeFilterLte: RangeFilterLte,
/**
* The ReplaceDocumentRequest model constructor.
* @property {module:model/ReplaceDocumentRequest}
Expand Down
24 changes: 12 additions & 12 deletions src/model/RangeFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
define(['ApiClient', 'model/RangeFilterLte'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
module.exports = factory(require('../ApiClient'), require('./RangeFilterLte'));
} else {
// Browser globals (root is window)
if (!root.Manticoresearch) {
root.Manticoresearch = {};
}
root.Manticoresearch.RangeFilter = factory(root.Manticoresearch.ApiClient);
root.Manticoresearch.RangeFilter = factory(root.Manticoresearch.ApiClient, root.Manticoresearch.RangeFilterLte);
}
}(this, function(ApiClient) {
}(this, function(ApiClient, RangeFilterLte) {
'use strict';


Expand Down Expand Up @@ -57,16 +57,16 @@
obj['field'] = ApiClient.convertToType(data['field'], 'String');
}
if (data.hasOwnProperty('lte')) {
obj['lte'] = ApiClient.convertToType(data['lte'], 'Number');
obj['lte'] = RangeFilterLte.constructFromObject(data['lte']);
}
if (data.hasOwnProperty('gte')) {
obj['gte'] = ApiClient.convertToType(data['gte'], 'Number');
obj['gte'] = RangeFilterLte.constructFromObject(data['gte']);
}
if (data.hasOwnProperty('lt')) {
obj['lt'] = ApiClient.convertToType(data['lt'], 'Number');
obj['lt'] = RangeFilterLte.constructFromObject(data['lt']);
}
if (data.hasOwnProperty('gt')) {
obj['gt'] = ApiClient.convertToType(data['gt'], 'Number');
obj['gt'] = RangeFilterLte.constructFromObject(data['gt']);
}
}
return obj;
Expand All @@ -77,19 +77,19 @@
*/
exports.prototype['field'] = undefined;
/**
* @member {Number} lte
* @member {module:model/RangeFilterLte} lte
*/
exports.prototype['lte'] = undefined;
/**
* @member {Number} gte
* @member {module:model/RangeFilterLte} gte
*/
exports.prototype['gte'] = undefined;
/**
* @member {Number} lt
* @member {module:model/RangeFilterLte} lt
*/
exports.prototype['lt'] = undefined;
/**
* @member {Number} gt
* @member {module:model/RangeFilterLte} gt
*/
exports.prototype['gt'] = undefined;

Expand Down
63 changes: 63 additions & 0 deletions src/model/RangeFilterLte.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Manticore Search Client
* Copyright (c) 2020-2021, Manticore Software LTD (https://manticoresearch.com)
*
* All rights reserved
*/

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.Manticoresearch) {
root.Manticoresearch = {};
}
root.Manticoresearch.RangeFilterLte = factory(root.Manticoresearch.ApiClient);
}
}(this, function(ApiClient) {
'use strict';



/**
* The RangeFilterLte model module.
* @module model/RangeFilterLte
* @version 4.0.0
*/

/**
* Constructs a new <code>RangeFilterLte</code>.
* @alias module:model/RangeFilterLte
* @class
*/
var exports = function() {
var _this = this;

};

/**
* Constructs a <code>RangeFilterLte</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/RangeFilterLte} obj Optional instance to populate.
* @return {module:model/RangeFilterLte} The populated <code>RangeFilterLte</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
}
return obj;
}




return exports;
}));


Loading

0 comments on commit 2ce6dc0

Please sign in to comment.