vermiculus / sx.el

Stack Exchange for Emacs
http://stackapps.com/q/3950
711 stars 40 forks source link

sx search results more restricted than browser's search results #296

Closed peterbecich closed 9 years ago

peterbecich commented 9 years ago

Some search queries in sx Search yield fewer results than the same query on a Stack Exchange site.

For example, I'll search for a question titled "improve doc-view display quality" on the Emacs Stack Exchange site: http://emacs.stackexchange.com/questions/876/improve-doc-view-display-quality

The query "doc-view quality" yields no results in sx, but same query yields the question in the browser: http://emacs.stackexchange.com/search?q=doc-view+quality

The query "doc-view display" in sx yields the question: 5 1 improve doc-view display quality 9mo ago [pdf] [docview] wdkrnls 938

Is the regex parser of sx queries more restricted than the one in the browser?

Malabarba commented 9 years ago

Unfortunately, that's a limitation of the stack exchange. API. =/ Last I checked, it only supports one form of searching, which is by strict substring. That's why doc-view display finds the question, whereas doc-view quality doesn't. The first is a strick substring, whereas the second is a fuzzier match.

Malabarba commented 9 years ago

Quoting the doc:

This method is intentionally quite limited. For more general searching, you should use a proper internet search engine restricted to the domain of the site in question.

vermiculus commented 9 years ago

Still, a less-specific search could be made via API and the restriction made clientside. It's a gross solution (and it shouldn't have to work like this) but it is possible.

Malabarba commented 9 years ago

Hmm. Good point. We could make one search for each word, and then take the intersection.

peterbecich commented 9 years ago

I see. The intentional limitation makes some sense. Many sites mirror and crawl Stack Exchange, and maybe this limited search API saves a little processing: http://meta.stackexchange.com/questions/131846/report-sites-that-use-stack-exchange-content-without-following-attribution-rules

vermiculus commented 9 years ago

I was thinking more along the lines of

  1. Search for foo.
  2. Search (search results for foo) for bar.

Fewer API calls.

Malabarba commented 9 years ago

Indeed, I think I like your version better.

Malabarba commented 9 years ago

Oh wait. It's a whoooole lot simpler than this. There's a search/advanced method that does what we want! :)

vermiculus commented 9 years ago

Woah!

peterbecich commented 9 years ago

Cool! Makes a big difference! Thanks.