Skip to content

Results vary on repeated calls for same query string [ClosestN] #5

@raghur

Description

@raghur

So I'm trying out your lib for building a fuzzy file matcher... input is 1000 filenames... I built a small python client that calls the server. The first time, the server builds the closestmatch.ClosestMatch structure and reuses it for subsequent calls. Interestingly, when I type in the same query, each time I'm getting 10 different results. Is this how its supposed to work?

Here's the server log:

fuzzy-denite\scratch>go run gopickle.go
INFO[0000] starting
ERRO[0013] /search: Context 12345 does not exist and no data passed
INFO[0013] Creating closestmatch context 12345
INFO[0014] Created new context 12345 of size 1000
INFO[0014] Searching for com in context 12345
INFO[0014] 10 matches for com. Will return max: 10 results
INFO[0018] Searching for com in context 12345
INFO[0018] 10 matches for com. Will return max: 10 results

Here's the client logs:

fuzzy-denite\scratch>python sender.py send closestmatch p1000.dat
['closestmatch', 'p1000.dat']
com
resending with data
200 OK
10
d:\code\go\src\github.com\josharian\impl\LICENSE.txt
d:\code\go\src\github.com\fatih\motion\main.go
d:\code\go\src\golang.org\x\text\LICENSE
d:\code\go\src\github.com\golang\dep\analyzer.go
d:\code\go\src\github.com\kisielk\gotool\go13.go
d:\code\go\src\google.golang.org\api\google-api-go-generator\clients_test.go
d:\code\go\src\github.com\tpng\gopkgs\LICENSE.txt
d:\code\go\src\gopkg.in\urfave\cli.v1\appveyor.yml
d:\code\go\src\github.com\nsf\gocode\scope.go
d:\code\go\pkg\dep\sources\https---github.com-sirupsen-logrus.git\formatter.go
com
200 OK
10
d:\code\go\src\github.com\BurntSushi\toml\COMPATIBLE
d:\code\go\pkg\dep\sources\https---github.com-onsi-gomega\matchers\be_closed_matcher_test.go
d:\code\go\pkg\dep\sources\https---github.com-spf13-cobra\command_notwin.go
d:\code\go\src\google.golang.org\api\examples\gopher.png
d:\code\go\src\github.com\BurntSushi\toml\doc.go
d:\code\go\pkg\dep\sources\https---github.com-sergi-go--diff\APACHE-LICENSE-2.0
d:\code\go\pkg\dep\sources\https---gopkg.in-yaml.v2\yamlh.go
d:\code\go\src\github.com\peterh\liner\output.go
d:\code\go\src\github.com\nsf\gocode\config.go
d:\code\go\src\github.com\sirupsen\logrus\doc.go

Sources and data are here - https://github.com/raghur/fuzzy-denite/tree/closestmatch/scratch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions