Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/claire elastic test #153

Merged
merged 100 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
6d4f96e
feat: project init
Jul 18, 2024
9a4e9aa
Revert "feat: project init"
Jul 18, 2024
d456b05
test: test searchEngine Instances
Jul 18, 2024
c6a15be
chore: cleanup
steve-lemon Jul 19, 2024
495a627
feat: add getVersion to get instance version info
Jul 19, 2024
94d0521
feat: add initService for concurrent testing of instances
Jul 19, 2024
b4016e5
feat: add ver-related changes to clearly distinguish vers
Jul 21, 2024
d2cab80
feat: add methods to modularize commons
Jul 21, 2024
c7d7b6a
refactor: review feedback
Jul 22, 2024
f22a209
chore: code review
steve-lemon Jul 22, 2024
4ec5827
feat: add parse-version
Jul 22, 2024
d3d7736
feat: modularize tests
Jul 22, 2024
999f807
refactor: exclude 'type' for 2.13
Jul 22, 2024
ae8140a
refactor: remove "parse-node-version" and add parseVersion method
Jul 23, 2024
2d17966
test: rename methods name
Jul 23, 2024
59624be
refactor: specify params type
Jul 23, 2024
ad32d45
feat: add 404 INDEX NOT FOUND to deleteItem
Jul 23, 2024
9db5ac9
chore: improve error logging in tests
Jul 24, 2024
57f9d80
chore: add comments to interfaces
Jul 24, 2024
3881691
refactor: add isOpenSearch() and exclude _type by result
Jul 24, 2024
04b99c7
chore: change type in Elastic6Service<any> to <MyModel>
Jul 25, 2024
98a4f37
chore: update isOpenSearch version check
Jul 25, 2024
4b9f212
feat: save `info` into `samples/<version>/info.json`
Jul 26, 2024
d200650
test: add test cases for updating w/ mismatched type
Jul 31, 2024
e1bd003
test: add test cases for auto indexing
Aug 1, 2024
c154a14
teat: add mismatchedTypeTest
Aug 1, 2024
04531eb
chore: add update-item.err400.mapping.json
Aug 5, 2024
901447c
test: add getIndexMapping to verify the mapping condition.
Aug 5, 2024
7d915d2
refactor: include root cause in error response
Aug 5, 2024
75ac3b2
chore: change object to object?
Aug 6, 2024
120dc3c
chore: cleanup
steve-lemon Aug 6, 2024
0a770fd
chore: code-review
steve-lemon Aug 6, 2024
03dc68f
test: test w/o network connection
Aug 6, 2024
4fb64d4
chore: improve performance of getVersion()
Aug 6, 2024
fb41ce2
chore: add "!"description to dummy error
Aug 6, 2024
209ea36
test: add totalSummary
Aug 6, 2024
a70c9db
feat: add saveInfoToFile & searchAll
Aug 7, 2024
a657d88
chore: add dummy bulk429error
Aug 7, 2024
80e1990
test: add version parse error test
Aug 7, 2024
6d2f10f
chore: rename dummy err
Aug 7, 2024
3adc5b4
chore: modify comments
Aug 7, 2024
f8154f6
test: optimize common searchRawResult
Aug 7, 2024
b754cb9
refactor: update parseVersion to return error message in response
Aug 7, 2024
2cdf812
refactor: get version from Elastic6Option
Aug 7, 2024
2cf591f
refactor: throw Error when parsedVersion makes err
Aug 8, 2024
da6b385
test: add searchAgent to autoIndexingTest
Aug 8, 2024
b7fbad2
refactor: control parseVersion err w/options.throwable
Aug 8, 2024
d25857a
test: increase test coverage 72 to 84
Aug 8, 2024
c3fd70b
chore: code review
steve-lemon Aug 9, 2024
8fe29ad
fix: test w/o network connection
Aug 9, 2024
67beee1
refactor: modified parseVersion() to parse version into major, minor,…
Aug 9, 2024
cefcdc6
feat: add executeSelfTest()
Aug 9, 2024
57d743a
test: test executeSelfTest
Aug 9, 2024
a19e69a
feat: add aggregationTest w/15000 data
Aug 19, 2024
f22d04e
feat: add searchFilterTest
Aug 21, 2024
f53181d
feat: add inline-function to check version
Aug 23, 2024
af1c022
test: update test code to validate data based on results
Aug 26, 2024
ca5617a
fix: add arguments needed to saveItems
Aug 26, 2024
aa0beed
test: test query-service of each version
Aug 27, 2024
2ce3ea0
test: add matchSearchTest
Aug 28, 2024
6ddecb0
fix: remove checking expectedMatchList2 for 2.13
Aug 28, 2024
c368b29
chore: add comments explaining _score algorithms
Aug 28, 2024
140e4c1
chore: add comments explaining _score algorithms
Aug 28, 2024
82425dc
refactor: modify bulk operation logic to handle dataset in chunks
Aug 29, 2024
29e43c1
chore: code-review
steve-lemon Aug 30, 2024
f8f8014
chore: clean up codes
Aug 30, 2024
6e11568
feat: define the response type `SearchResponse`
Aug 30, 2024
a6883db
test: add empty '' test
Aug 30, 2024
c8d910b
refactor: modify to test using search() only
Aug 30, 2024
dc8001c
feat: add indexItem to overwrite whole docs
Sep 2, 2024
8081461
chore: cleanup
steve-lemon Sep 3, 2024
6cc4dd6
refactor: fix increment of updateItem to work
Sep 3, 2024
038e541
refactor: make updateItem overwrite with script
Sep 3, 2024
292b533
fix: remove indexItem
Sep 5, 2024
7ab5f40
feat: extract the general super class `ElasticIndexService` => versio…
Sep 5, 2024
c624c8e
refactor: improve updateItem for ACID
Sep 5, 2024
16c8d36
chore: fix comments
Sep 9, 2024
b0ad126
test: add doTest
Sep 9, 2024
604f00b
refactor: switch to using Index API for update logic
Sep 9, 2024
ad5ebc6
chore: add comments
Sep 9, 2024
123a4e3
refactor: add incrementItem to updateResponse
Sep 10, 2024
6d14dc5
test: add update readback check
Sep 10, 2024
b529474
feat: prevent overwriting on update, allow overwriting on save
Sep 10, 2024
02b08ad
test: add increment test
Sep 10, 2024
5fd1b1e
feat: support increments in dummy.
Sep 12, 2024
a84be4c
chore: cleanup codes
Sep 12, 2024
719db27
feat: add versionChecking to prepareSettings
Sep 12, 2024
8ccae79
refactor: move isOldES6 logic to Elastic6Service
Sep 23, 2024
645ab63
test: improve test codes
Sep 23, 2024
7602e27
refactor: remove unnecessary if statement
Sep 23, 2024
d3e2a2f
chore: cleanup
steve-lemon Sep 24, 2024
551377c
test: feat _ver()
Sep 24, 2024
c1d7613
refactor: improve update to overwrite extra
Sep 24, 2024
9bec0a9
fix: undo Elastic6Service override
Sep 24, 2024
909f352
test: feat CRUDModel interface
Sep 24, 2024
e4618df
test: add testcase
Sep 26, 2024
cddea0a
feat: add abstarct ElasticIndexService class
Sep 26, 2024
958ea57
chore: opt ElasticItem
steve-lemon Sep 30, 2024
f8756e4
refactor: improve Elastic Classes
Sep 30, 2024
73965b2
test: improve CRUDModel Interface
Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/cores/elastic/elastic6-query-service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { canPerformTest, VERSIONS } from './elastic6-service.spec';
import * as $elastic from './elastic6-service.spec';

const instance = (indexName = 'test-v4') => {
const version = ['6.2', '6.8', '7.1'][0] as VERSIONS;
const version = ['6.2', '6.8', '7.1', '7.2', '0'][3] as VERSIONS;
const { service: elastic, options } = $elastic.instance(version, true, indexName);
const search: Elastic6QueryService<any> = new Elastic6QueryService(elastic);
return { elastic, search, options, indexName };
Expand All @@ -29,19 +29,18 @@ describe('Elastic6QueryService', () => {
jest.setTimeout(120000);

// service identity
it('should pass basic CRUD w/ dummy', async done => {
it('should pass basic CRUD w/ dummy', async () => {
const { elastic, search, options } = instance();
/* eslint-disable prettier/prettier */
const { version } = options;
expect2(() => elastic.hello()).toEqual(`elastic6-service:test-v4:${version}`);
expect2(() => search.hello()).toEqual(`elastic6-query-service:test-v4`);
expect2(() => options, 'idName,autocompleteFields').toEqual({ idName: '$id', autocompleteFields: ['title', 'name'] });
/* eslint-enable prettier/prettier */
done();
});

// test buildQueryBody()
it('should pass buildQueryBody()', async done => {
it('should pass buildQueryBody()', async () => {
const { search } = instance();

expect2(() => search.buildQueryBody({ _x: 0, a: 1 })).toEqual({
Expand All @@ -50,17 +49,15 @@ describe('Elastic6QueryService', () => {
expect2(() => search.buildQueryBody({ '!a': 2, b: '3,4', c: '' })).toEqual({
query: { query_string: { query: 'a:(NOT 2) AND b:(3 OR 4) AND c:""' } },
});

done();
});

// autocomplete search
it('should pass autocomplete search', async done => {
if (!PROFILE) return done(); // ignore w/o profile
it('should pass autocomplete search', async () => {
if (!PROFILE) return; // ignore w/o profile
const { elastic, search, indexName } = instance('test-autocomplete-v4');

//! break if no live connection
if (!(await canPerformTest(elastic))) return done();
if (!(await canPerformTest(elastic))) return;

//! make sure if index is ready.
const $old = await elastic.findIndex(indexName);
Expand Down Expand Up @@ -90,16 +87,15 @@ describe('Elastic6QueryService', () => {
expect2(await search.searchAutocomplete({ $query: { title: 'de' }, $filter: { type: 'department' } }), 'total').toEqual({ total: 1 }); // Design Lab

/* eslint-enable prettier/prettier */
done();
});

// search quality
it('should pass check search quality', async done => {
if (!PROFILE) return done(); // ignore w/o profile
it('should pass check search quality', async () => {
if (!PROFILE) return; // ignore w/o profile
const { elastic, search, indexName } = instance('test-quality-v4');

//! break if no live connection
if (!(await canPerformTest(elastic))) return done();
if (!(await canPerformTest(elastic))) return;

//! make sure if index is ready.
const $old = await elastic.findIndex(indexName);
Expand Down Expand Up @@ -221,6 +217,5 @@ describe('Elastic6QueryService', () => {
expect2(await autocompleteSearch2('Ehadi')).toEqual(['똠얌꿍 끓이는 법']);

/* eslint-enable prettier/prettier */
done();
});
});
Loading