Show Count of Matches in Vim

Modern Vim Starting with Vim 8.1.1270, there’s a new feature in core to show the current match position. NeoVim enables this functionality by default, but standard Vim does not. To enable it in standard Vim, run: :set shortmess-=S Originally mentioned below in Ben’s answer, and added here for visibility. Older Versions In Vim 7.4+, the … Read more

How to search for a string in files with Ant (make sure certain string isn’t found in source files)

You might consider using fileset selectors to do this. Selectors allow you to choose files based on content, size, editability and so on. You can combine selectors with name-based includes and excludes, or patternsets. Below is an example. The second fileset is derived from the first, with a selector that simply matches on file content. … Read more

“Did you mean?” feature in Lucene.net

You should look into the SpellChecker module in the contrib dir. It’s a port of Java lucene’s SpellChecker module, so its documentation should be helpful. (From the javadocs:) Example Usage: import org.apache.lucene.search.spell.SpellChecker; SpellChecker spellchecker = new SpellChecker(spellIndexDirectory); // To index a field of a user index: spellchecker.indexDictionary(new LuceneDictionary(my_lucene_reader, a_field)); // To index a file containing … Read more

how do I normalise a solr/lucene score?

To quote http://wiki.apache.org/lucene-java/ScoresAsPercentages: People frequently want to compute a “Percentage” from Lucene scores to determine what is a “100% perfect” match vs a “50%” match. This is also somethings called a “normalized score” Don’t do this. Seriously. Stop trying to think about your problem this way, it’s not going to end well. That page does … Read more

How to put a delay on AngularJS instant search?

UPDATE Now it’s easier than ever (Angular 1.3), just add a debounce option on the model. <input type=”text” ng-model=”searchStr” ng-model-options=”{debounce: 1000}”> Updated plunker: http://plnkr.co/edit/4V13gK Documentation on ngModelOptions: https://docs.angularjs.org/api/ng/directive/ngModelOptions Old method: Here’s another method with no dependencies beyond angular itself. You need set a timeout and compare your current string with the past version, if both … Read more