NuGet/NuGet.Services.Search — pull request #27 by anurse (2014-08-13 23:36:56+00:00)
Title: Added Target Framework indexing

It finally works!

During indexing, the indexer applies Facets that can be used in queries as boolean matches:
* c<*fxname*> -> Compatible with *fxname*
* l_pre<*fxname*> -> Latest Prerelease Version of this package for *fxname*
* l_pre<> -> Latest Prerelease Version ignoring framework
* l_s<*fxname*> -> Latest Stable Version of this package for *fxname*
* l_s<> -> Latest Stable Version ignoring framework

Now, when searching, we can apply a boolean clause to the query to find the latest version. For example, if searching for "EntityFramework", with includePrerelease enabled and supportedFramework set to 'net40', the query is something like:

```
EntityFramework +Facet:l_pre
```

Only zero or one versions of any particular package can have `l_pre` or `l_s` for any given fxname, so this also ensures that a single version of each result is returned. The indexing burden appears to be light and the query burden is no more than adding additional constraints would normally be. We can convert the Query to a Filter (a cached list of documents used as the start-set for searches before even considering query terms) if it does become a query-time perf issue.