mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Update elasticlunr Types (#46986)
Update the elasticlunr types, to have the expand option in the correct place not within fields. https://github.com/gatsby-contrib/gatsby-plugin-elasticlunr-search#partial-searches
This commit is contained in:
parent
01079a9b7d
commit
99f0e71149
@ -37,7 +37,7 @@ index.coordNorm({ doc: 1 }, { doc: ['token'] }, 1);
|
||||
index.fieldSearch(['ok'], 'field', { field: { boost: 10 } });
|
||||
index.fieldSearch(['ok'], 'field', { field: { boost: 10, bool: 'OR' } });
|
||||
index.fieldSearch(['ok'], 'field', { field: { boost: 10, bool: 'AND' } });
|
||||
index.fieldSearch(['ok'], 'field', { field: { boost: 10, expand: true } });
|
||||
index.fieldSearch(['ok'], 'field', { field: { boost: 10 } });
|
||||
|
||||
index.fieldSearchStats({ doc: ['ok'] }, 'ok', { doc: testDoc });
|
||||
|
||||
@ -73,6 +73,10 @@ index.search('query', {
|
||||
},
|
||||
});
|
||||
|
||||
index.search('query', {
|
||||
expand: true
|
||||
});
|
||||
|
||||
index.toJSON();
|
||||
|
||||
index.updateDoc(testDoc);
|
||||
|
||||
2
types/elasticlunr/index.d.ts
vendored
2
types/elasticlunr/index.d.ts
vendored
@ -91,12 +91,12 @@ declare namespace elasticlunr {
|
||||
[K in keyof T]?: {
|
||||
bool?: Bool;
|
||||
boost?: number;
|
||||
expand?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
interface SearchConfig<T> {
|
||||
fields?: FieldSearchConfig<T>;
|
||||
expand?: boolean;
|
||||
}
|
||||
|
||||
interface SerialisedInvertedIndex {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user