Skip to content

Commit

Permalink
Revert query relevance display work
Browse files Browse the repository at this point in the history
This reverts the following commits:

  * 0530f35
  * 85c4ed2
  * f515f0f
  * d33f427
  * 2634f33
  * 5f7ce19
  * 4eb6a9c
  * ef0bc23
  * ad23357
  * 1b7f153
  * 7c78ebd
  * 1685d8a

See GH #16 for reason why the work was done in the first place

I'm reverting this because it's painfully slow right now, and it's going
to take a good amount of work to make it fast, if it's at all possible.
This feature wasn't originally slated for the 1.1.0 release, so I'm
pulling out all of the code I wrote for it in order to make 1.1.0
happen; afterwards I can unrevert it when I'm ready to commit to adding
the feature in a future release
  • Loading branch information
hoelzro committed Oct 14, 2018
1 parent 9b3e5eb commit ec3c282
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 216 deletions.
13 changes: 0 additions & 13 deletions demo/Introduction.tid
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@ To install, drag and drop these plugins into your wiki:
</$set>
</$list>

Optionally, if you want the plugin to display a fancy bar next to each search result indicating how closely it matched the search, install Tobias' sparkl plugin:

<$list filter="$:/plugins/tobibeer/sparkl">
<$set name="plugin-type" value={{!!plugin-type}}>
<$set name="default-popup-state" value="no">
<$set name="qualified-state" value=<<qualify "$:/state/plugin-info">>>
{{||$:/core/ui/Components/plugin-info}}
</$set>
</$set>
</$set>
</$list>


! Using FTS machinery in your own ~TiddlyWiki creations

This plugin provides a filter operator named `ftsearch` which you can use in conjunction with other filter operators; it works exactly like ~TiddlyWiki's `search` operator, only you can't specify which field to search on - it always searches on title, tags, and text.
Expand Down
98 changes: 0 additions & 98 deletions demo/sparkl.tid

This file was deleted.

2 changes: 1 addition & 1 deletion ftsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module FTSearch {
return function(callback) {
for(let match of results) {
if(match.ref in sourceLookup) {
callback(sourceLookup[match.ref], match.ref, match.score);
callback(sourceLookup[match.ref], match.ref);
}
}
}
Expand Down
33 changes: 0 additions & 33 deletions ftsgatherscores.ts

This file was deleted.

33 changes: 0 additions & 33 deletions score-to-sparkl-values.ts

This file was deleted.

19 changes: 1 addition & 18 deletions search-results.tid
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,7 @@ caption: Full Text Results
{{$:/language/Search/Matches}}
</$set>

<table style="border-width: 0; margin: 0">
<$list filter="[ftsearch{$(searchTiddler)$}ftsgatherscores[$:/temp/score-data]]">
<$set name="score" filter="$:/temp/score-data +[getindex<currentTiddler>]" select="0">
<$wikify name="sparklValues" text="""<$macrocall $name="fts-score-to-sparkl-values" score=<<score>> />""" mode="inline">
<tr>
<td style="border-width: 0; padding: 0 7px 0 0">
<$link to={{!!title}}>
<$view field="title"/>
</$link>
</td>
<$list filter="[title[$:/plugins/tobibeer/sparkl]get[title]]">
<td style="border-width: 0; padding: 0 0 0 7px"><$macrocall $name="sparkl" values=<<sparklValues>> /></td>
</$list>
</tr>
</$wikify>
</$set>
</$list>
</table>
<$list filter="[ftsearch{$(searchTiddler)$}]" template="$:/core/ui/ListItemTemplate"/>
\end

<$set name="state" value="$:/temp/FTS-state">
Expand Down
20 changes: 0 additions & 20 deletions tests/test-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,26 +385,6 @@ https://jaredforsyth.com/2017/07/05/a-reason-react-tutorial/
expect(foxesFoxesFoxesIndex).toBeLessThan(foxInGardenIndex);
});
});

it('should gather scoring information into a tiddler if asked', function() {
prepare().then(function() {
let results = wiki.filterTiddlers('[ftsearch[fox]ftsgatherscores[$:/temp/score-data]]');
let scoringData = wiki.getTiddlerData('$:/temp/score-data');
expect('Foxes foxes foxes' in scoringData).toBeTruthy();
expect('A fox in the garden' in scoringData).toBeTruthy();
});
});

it('should never have scores that exceed 1.0', function() {
prepare().then(function() {
let results = wiki.filterTiddlers('[ftsearch[fox]ftsgatherscores[$:/temp/score-data]]');
let scoringData = wiki.getTiddlerData('$:/temp/score-data');

for(let score of Object.values(scoringData)) {
expect(score).not.toBeGreaterThan(1.0);
}
});
});
});

describe('Cache tests', function() {
Expand Down

0 comments on commit ec3c282

Please sign in to comment.