mirror of
https://gitlab.com/walljm/dynamicbible.git
synced 2025-07-23 23:39:50 -04:00
allow quoted searches
This commit is contained in:
parent
f95bf62cdb
commit
528855895d
@ -52,10 +52,6 @@ export class SearchPage extends SubscriberComponent
|
|||||||
this.appService.getAutoComplete(value.toLowerCase())
|
this.appService.getAutoComplete(value.toLowerCase())
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
this.cards$.subscribe((state) => {
|
|
||||||
console.log('Cards updated...');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
|
@ -636,7 +636,11 @@ export class AppService extends createStateService(reducer, initialState) {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const stem = this.wordToStem.get(q);
|
|
||||||
|
const stem =
|
||||||
|
q.startsWith('"') && q.endsWith('"')
|
||||||
|
? q.split('"').join('') // if its quoted, search the exact term.
|
||||||
|
: this.wordToStem.get(q); // otherwise use the stem to get a broader set of results.
|
||||||
|
|
||||||
// handle the first case.
|
// handle the first case.
|
||||||
if (stem <= this.searchIndexArray[0]) {
|
if (stem <= this.searchIndexArray[0]) {
|
||||||
@ -649,8 +653,7 @@ export class AppService extends createStateService(reducer, initialState) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For each query term, figure out which xml file it is in, and get it.
|
// For each query term, figure out which file it is in, and get it.
|
||||||
// getSearchRefs returns an array of references.
|
|
||||||
for (let w = 1; w < this.searchIndexArray.length; w++) {
|
for (let w = 1; w < this.searchIndexArray.length; w++) {
|
||||||
// If we are at the end of the array, we want to use a different test.
|
// If we are at the end of the array, we want to use a different test.
|
||||||
if (
|
if (
|
||||||
@ -1066,6 +1069,8 @@ export class AppService extends createStateService(reducer, initialState) {
|
|||||||
prefix = keyword.substr(0, idx).trim() + '; ';
|
prefix = keyword.substr(0, idx).trim() + '; ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qry = qry.split('"').join(''); // remove any quotes, just in case
|
||||||
|
|
||||||
if (qry.search(/[0-9]/i) === -1) {
|
if (qry.search(/[0-9]/i) === -1) {
|
||||||
// its a word
|
// its a word
|
||||||
for (const item of BibleReference.Books) {
|
for (const item of BibleReference.Books) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user