Comments (2)
Thanks for the bug report @ApsaraDhanasekar11. I think I understand your problem, but there are too many variables to reproduce it accurately.
Could you include a standalone script/test that demonstrates the issue?
from search-index.
Hi @fergiemcdowall , thanks for replying back. Please find the below example code and help us with details. Thanks!
const levelup = require('levelup');
const si = require('search-index');
const s3leveldown = require('s3leveldown');
const s3Store = await levelup(s3leveldown(bucketName, S3Client));
const idx = await si({
db: s3Store,
storeVectors: true
});
let data = [
{
_id: 'a',
description: 'Use template to list'
},
{
_id: 'b',
description: 'All versions and updates'
},
{
_id: 'c',
description: 'Final is the file name'
}
];
const result = await idx.PUT(data, {
storeVectors: true });
// results is :: [
{ _id: 'a', operation: 'PUT', status: 'CREATED' },
{ _id: 'b', operation: 'PUT', status: 'CREATED' },
{ _id: 'c', operation: 'PUT', status: 'CREATED' }
]
// ****** The above code creates the index as below::
{ key: 'description:file#1.00', value: [ 'c' ] }
{ key: 'description:final#1.00', value: [ 'c' ] }
{ key: 'description:list#1.00', value: [ 'a' ] }
{ key: 'description:name#1.00', value: [ 'c' ] }
{ key: 'description:template#1.00', value: [ 'a' ] }
{ key: 'description:updates#1.00', value: [ 'b' ] }
{ key: 'description:use#1.00', value: [ 'a' ] }
{ key: 'description:versions#1.00', value: [ 'b' ] }
{ key: '○DOCUMENT_COUNT○', value: 3 }
{
key: '○DOC_RAW○a○',
value: { _id: 'a', description: 'Use template to list' }
}
{
key: '○DOC_RAW○b○',
value: { _id: 'b', description: 'All versions and updates' }
}
{
key: '○DOC_RAW○c○',
value: { _id: 'c', description: '"Final is the file name' }
}
{
key: '○DOC○a○',
value: {
_id: 'a',
description: [ 'list#1.00', 'template#1.00', 'to#1.00', 'use#1.00' ]
}
}
{
key: '○DOC○b○',
value: {
_id: 'b',
description: [ 'all#1.00', 'and#1.00', 'updates#1.00', 'versions#1.00' ]
}
}
{
key: '○DOC○c○',
value: {
_id: 'c',
description: [ 'file#1.00', 'final#1.00', 'is#1.00', 'name#1.00', 'the#1.00' ]
}
}
{ key: '○FIELD○description○', value: 'description' }
//// ************************* ///////
// ****** For the Search/ query : ******* //
const result = await indexedDb.QUERY( {
GET: {
FIELD: ['description'],
VALUE: {
GTE: 'versions',
LTE: 'versions'
},
}
}); ----> Tried other options like Query->(GET, SEARCH) , _SEARCH, _GET
But the result was ::
RESULT: [
{
_id: 'c',
_match: [
'description:file#1.00',
'description:final#1.00',
'description:name#1.00'
]
},
{
_id: 'a',
_match: [
'description:list#1.00',
'description:template#1.00',
'description:use#1.00'
]
},
{
_id: 'b',
_match: [ 'description:updates#1.00', 'description:versions#1.00' ]
}
],
RESULT_LENGTH: 3
} :: which is actually giving results of all previous alphabetical words from a-v (as "versions" begins with v)
While trying to identify the process flow, I noticed the GET function has internal implementation of db.createReadStream method which should actually filter the data according to the keywords passed in GTE & LTE. But looks like this is failing and instead bringing up the entire result set restricting upto the first character (alphabetic order)..
from search-index.
Related Issues (20)
- Code examples link is broken HOT 5
- Indexing documents with empty object props HOT 4
- No results found after upgrading from 2.4.0 to 3.0.2 HOT 3
- Optimizing the document format for internal field management. HOT 1
- string values consisting only of special chars break tokenization chain HOT 4
- IMPORT/EXPORT between version 2.4 and 3.1 HOT 1
- Avoid result with 0 count on FACET HOT 1
- Token parsing doesn't accommodate for values that include `:` HOT 6
- switch to `abstract-level` from `abstract-leveldown` HOT 1
- Using search-index with redisdown gives error HOT 4
- document LAST_UPDATED()
- CREATED and LAST_UPDATED should have human readable dates instead of millisecond timestamps
- DOC_VECTORs should be retrievable
- Instantiate using class syntax HOT 1
- Find old results after updating document with same ID but new data HOT 3
- Bundling a little better? HOT 9
- Initializing with an instance of Level HOT 4
- Browser: Uncaught SyntaxError: ambiguous indirect export: si HOT 9
- Numeric SORT not working as expected HOT 3
- How to persist index on disk? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from search-index.