Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Commit

Permalink
lowercase fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Sep 14, 2018
1 parent 2fadcb8 commit d980825
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ export class SearchService implements SearchServiceAbstraction {
this.index = null;
const builder = new lunr.Builder();
builder.ref('id');
(builder as any).field('shortId', { boost: 100, extractor: (c: CipherView) => c.id.substr(0, 8) });
(builder as any).field('shortid', { boost: 100, extractor: (c: CipherView) => c.id.substr(0, 8) });
(builder as any).field('name', { boost: 10 });
(builder as any).field('subTitle', {
(builder as any).field('subtitle', {
boost: 5,
extractor: (c: CipherView) => {
if (c.subTitle != null && c.type === CipherType.Card) {
Expand Down Expand Up @@ -110,7 +110,7 @@ export class SearchService implements SearchServiceAbstraction {
const soWild = lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING;
searchResults = index.query((q) => {
q.term(query, { fields: ['name'], wildcard: soWild });
q.term(query, { fields: ['subTitle'], wildcard: soWild });
q.term(query, { fields: ['subtitle'], wildcard: soWild });
q.term(query, { fields: ['login.uris'], wildcard: soWild });
lunr.tokenizer(query).forEach((token) => {
q.term(token.toString(), {});
Expand Down

0 comments on commit d980825

Please sign in to comment.