Skip to content

Navigation Menu

Sign up

Search query interpretation

plajjan edited this page Jan 15, 2013 · 5 revisions

Empty query string

Empty searches from the CLI will give the same result as searching for ''. Since smart_search_* does a regexp search for strings, it will match and return all prefixes.

While in a large ISP setup with thousands of prefixes, it doesn't make much sense to list everything, it does make sense in smaller deployments or if coupled with a VRF selection. If nothing else, it's nice for new users that just running a search returns something.

extra arguments to CLI

nipap address list FOO will issue a smart search for "FOO" which in turn will do a regexp match on a bunch of text fields, including the description and comment field. If we want to just do a regexp match in the comment field, the idea is to use the keyword "comment", like so: nipap address list comment FOO. The CLI will match the "comment" argument and put the argument to it in a dict-SQL which will be passed to smart_search in the extra_query argument.

For all these extra arguments, there is the question on how to build the dict-SQL and specifically what search operator to use. For different arguments, the operator should probably be different, for a free text field (like description) an unanchored regexp is suitable while for an integer field, it doesn't fit at all.

Current strategy is to use anchored regexps for things like VRF RT. Novice users will get what they want while more experienced users can use regexp and perform more advanced queries.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /