-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposed new search lexicons #1594
Changes from all commits
27d2145
12f3711
0d91339
25a21f9
288d113
7166933
f4163b0
49cc94f
a74d871
a698e65
f41ddab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,19 @@ | |
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"term": { "type": "string" }, | ||
"term": { | ||
"type": "string", | ||
"description": "DEPRECATED: use 'q' instead" | ||
}, | ||
"q": { | ||
"type": "string", | ||
"description": "search query prefix; not a full query string" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 50 | ||
"default": 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice i dig both of these new defaults 👍 |
||
} | ||
} | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.feed.searchPosts", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Find posts matching search criteria", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["q"], | ||
"properties": { | ||
"q": { | ||
"type": "string", | ||
"description": "search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 25 | ||
}, | ||
"cursor": { | ||
"type": "string", | ||
"description": "optional pagination mechanism; may not necessarily allow scrolling through entire result set" | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["posts"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"hitsTotal": { | ||
"type": "integer", | ||
"description": "count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits" | ||
}, | ||
"posts": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "app.bsky.feed.defs#postView" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [{ "name": "BadQueryString" }] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.unspecced.defs", | ||
"defs": { | ||
"skeletonSearchPost": { | ||
"type": "object", | ||
"required": ["uri"], | ||
"properties": { | ||
"uri": { "type": "string", "format": "at-uri" } | ||
} | ||
}, | ||
"skeletonSearchActor": { | ||
"type": "object", | ||
"required": ["did"], | ||
"properties": { | ||
"did": { "type": "string", "format": "did" } | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.unspecced.searchActorsSkeleton", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Backend Actors (profile) search, returning only skeleton", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["q"], | ||
"properties": { | ||
"q": { | ||
"type": "string", | ||
"description": "search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax" | ||
}, | ||
"typeahead": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it make sense to use a non-normative parameter for this? something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm, I feel like typeahead is pretty term-of-art for this query type (not just the term we are using). different sub-set of fields are queried, and only really works for prefix of a single token or two, character-by-character. "simple" or "quick" would be confusing to me, i'd assume that they would return un-hydrated responses or something (responses are always hydrated). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool cool - i'm game for "typeahead" 👍 |
||
"type": "boolean", | ||
"description": "if true, acts as fast/simple 'typeahead' query" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 25 | ||
}, | ||
"cursor": { | ||
"type": "string", | ||
"description": "optional pagination mechanism; may not necessarily allow scrolling through entire result set" | ||
} | ||
Comment on lines
+26
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the past it's proven useful to not support a cursor for typeahead search. Just wanted to note that in case it's relevant here, since both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would the alternative be a second endpoint just for typeahead? That feels expansive to me. I think in typeahead mode we can safely ignore the |
||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["actors"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"hitsTotal": { | ||
"type": "integer", | ||
"description": "count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits" | ||
}, | ||
"actors": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "app.bsky.unspecced.defs#skeletonSearchActor" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [{ "name": "BadQueryString" }] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.unspecced.searchPostsSkeleton", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Backend Posts search, returning only skeleton", | ||
"parameters": { | ||
"type": "params", | ||
"required": ["q"], | ||
"properties": { | ||
"q": { | ||
"type": "string", | ||
"description": "search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 25 | ||
}, | ||
"cursor": { | ||
"type": "string", | ||
"description": "optional pagination mechanism; may not necessarily allow scrolling through entire result set" | ||
} | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["posts"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"hitsTotal": { | ||
"type": "integer", | ||
"description": "count of search hits. optional, may be rounded/truncated, and may not be possible to paginate through all hits" | ||
}, | ||
"posts": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "app.bsky.unspecced.defs#skeletonSearchPost" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"errors": [{ "name": "BadQueryString" }] | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would support phasing out
term
and phasing inq
I think "term" makes sense when it's simple search on a word & no additional syntax is allowed
q
fits nicely when we allow for special query syntax (like Lucene syntax)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I updated all the instances of 'term' as a search query with 'q', and marked the old 'term' fields as "DEPRECATED" in description. This impacted an admin route as well. Idea is that for a short transition we'll fall back to "term" if "q" is empty, and maybe eventually nuke them (if/when we are feeling comfortable breaking query params in Lexicons in a small way, like a v1.0 release)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup that works 👍