<p>I've found how to sort query results by a given field in a Lucene.Net index instead of by score; all it takes is a field that is indexed but not tokenized. However, what I haven't been able to figure out is how to sort that field while ignoring stop words such as "a" and "the", so that the following book titles, for example, would sort in ascending order like so:</p>

<ol>
<li>The Cat in the Hat</li>
<li>Horton Hears a Who</li>
</ol>

<p>Is such a thing possible, and if yes, how?</p>

<p>I'm using Lucene.Net 2.3.1.2.</p>

[{'answer_id': 66084, 'author': 'John Sheehan', 'author_id': 1786, 'author_profile': 'https://Stackoverflow.com/users/1786', 'pm_score': 0, 'selected': False, 'text': '<p>When you create your index, create a field that only contains the words you wish to sort on, then when retrieving, sort on that field but display the full title.</p>\n'}, {'answer_id': 66093, 'author': 'David Thibault', 'author_id': 5903, 'author_profile': 'https://Stackoverflow.com/users/5903', 'pm_score': 0, 'selected': False, 'text': "<p>It's been a while since I used Lucene but my guess would be to add an extra field for sorting and storing the value in there with the stop words already stripped. You can probably use the same analyzers to generate this value.</p>\n"}, {'answer_id': 66356, 'author': 'Peaeater', 'author_id': 9432, 'author_profile': 'https://Stackoverflow.com/users/9432', 'pm_score': 0, 'selected': False, 'text': "<p>There seems to be a catch-22 in that you must tokenize a field with an analyzer in order to strip punctuation and stop words, but you can't sort on tokenized fields. How then to strip the stop words without tokenizing?</p>\n"}, {'answer_id': 66732, 'author': 'Paul Mrozowski', 'author_id': 3656, 'author_profile': 'https://Stackoverflow.com/users/3656', 'pm_score': 2, 'selected': True, 'text': '<p>I wrap the results returned by Lucene into my own collection of custom objects. Then I can populate it with extra info/context information (and use things like the highlighter class to pull out a snippet of the matches), plus add paging. If you took a similar route you could create a "result" class/object, add something like a SortBy property and grab whatever field you wanted to sort by, strip out any stop words, then save it in this property. Now just sort the collection based on that property instead.</p>\n'}, {'answer_id': 1200458, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>For search, I found <a href="http://www.logiclabz.com/c/search-lucene-index-in-net-c-with-sorting-options.aspx" rel="nofollow noreferrer">search lucene .net index with sort option</a> link interesting to solve ur problem</p>\n'}]
['https://Stackoverflow.com/questions/66041', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9432/']