const Cc = Components.classes; const Ci = Components.interfaces; var factory = Cc["@skrul.com/xpclucene-factory;1"].getService(Ci.nsILuceneFactory); var data = [ { "link" : "http://en.wikipedia.org/wiki/Plain_Old_Telephone_System", "content" : "foobar MajorBlunder asks: I'm part of the IT department of a small but prospering software company. We have recently filled the capacity of the POTS PBX phone system we currently have installed. We are currently looking into switching over to a VoIP phone system. We have a sizable IT staff in proportion to the rest of the company, so we'd like to be able to maintain the hardware/software in house as much as possible. I wanted to ask the Slashdot readership what experiences they have had with switching over to from POTS to VoIP. Any recomendations for full end to end solutions would be appreciated, and recomendations of things to avoid would be great.", "updated" : "2005-02-09T21:40:00" }, { "link" : "http://ask.slashdot.org/article.pl?sid=05/11/30/0048221&tid=129&tid=4", "content" : "foobar videoPIP asks: \"I recently finished putting together my home theater (including a projector). As I sit there and watch stuff on the big screen, I remember a time back in college where my housemates and I would have 2 or 3 TVs crammed into the entertainment center, one usually having a football game on and the other playing movies or for video games. This got me to thinking - I know that, for CCTV security systems, they have 4 screens visible at a time, but they are usually black and white (like at Best Buy). I've looked on Google for these, and there are all sorts of configurations (4/9/16 channels), (simplex/duplex,triplex). I was wondering if anyone has married one of these multiplexers with a projector, or even a very large TV to get the ultimate Picture-in-Picture experience?\"", "updated" : "20050210214000" }, { "link" : ":/shazam", "content" : "a little bit of content", "updated" : "20050211214000" }, ]; var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); file.initWithPath("/home/steve/dev/mozilla/extensions/xpclucene/test/index_keywords"); var analyzer = factory.getAnalyzer(0); var writer = factory.getIndexWriter(file, analyzer, true, true); var fields = []; var docs = []; for(var i = 0; i < data.length; i++) { var doc = factory.createDocument(); doc.add(factory.createTextStringField("content", data[i]["content"], true)); doc.add(factory.createTextKeywordField("link", data[i]["link"])); doc.add(factory.createTextKeywordField("updated", data[i]["updated"])); writer.addDocument(doc); } writer.close(); var reader = factory.getIndexReader(file); var query = factory.parseQuery("updated:2005\\-02\\-09T*", "content", analyzer); //var query = factory.createSingleTermQuery("link", "http://ask.slashdot.org/article.pl?sid=05/11/30/0048221&tid=129&tid=4"); var indexSearcher = factory.getIndexSearcher(reader); var hits = indexSearcher.search(query); for(var i = 0; i < hits.length(); i++) { print(i + " " + hits.doc(i).get("link") + " " + hits.doc(i).get("updated") + "\n"); } reader.close();