Skip to content

draft: regex search#56

Open
darukutsu wants to merge 1 commit intomoson-mo:mainfrom
darukutsu:regex-search
Open

draft: regex search#56
darukutsu wants to merge 1 commit intomoson-mo:mainfrom
darukutsu:regex-search

Conversation

@darukutsu
Copy link
Copy Markdown
Contributor

fixes #44

  • implement cache.go regex search (maybe)
  • regex search (partial, see bellow)
  • remove minimum search restriction (not quite good ?)
  • better result ranking (no longer dependent on 3rd party for now)

I choose RE2 standard (perl, python...), but POSIX is also easy to implement, if for some reason someone wants.

For now searching on AUR works as following:

  • from search-term are removed special characters - except .-
  • then on result we perform regex matching

I'm not aware how can I search using regex on api. I was thinking since we're using 3rd party aur pkgmanager, isn't it better to delegate term searching to it? But then not everybody implements regex. And this support is at least something. See for example Jguer/yay#1922.

Searching on alpm is fully working as expected.

Also removed need for config options SearchMode since we can use ^ and other regex...

Comment thread internal/pacseek/aur.go

req, err := http.NewRequest("GET", aurUrl+"?v=5&type="+t+"&arg="+url.QueryEscape(term), nil)
// TODO: find a way to search using regex
// or download all results from aur and then search using regex
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this how alpm works? Is this good idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] search using regex

1 participant