Search Results

Search found 2 results on 1 pages for 'chardex'.

Page 1/1 | 1 

  • Lucene DuplicateFilter question

    - by chardex
    Hi, Why DuplicateFilter doesn't work together with other filters? For example, if a little remake of the test DuplicateFilterTest, then the impression that the filter is not applied to other filters and first trims results: public void testKeepsLastFilter() throws Throwable { DuplicateFilter df = new DuplicateFilter(KEY_FIELD); df.setKeepMode(DuplicateFilter.KM_USE_LAST_OCCURRENCE); Query q = new ConstantScoreQuery(new ChainedFilter(new Filter[]{ new QueryWrapperFilter(tq), // new QueryWrapperFilter(new TermQuery(new Term("text", "out"))), // works right, it is the last document. new QueryWrapperFilter(new TermQuery(new Term("text", "now"))) // why it doesn't work? It is the third document. }, ChainedFilter.AND)); ScoreDoc[] hits = searcher.search(q, df, 1000).scoreDocs; assertTrue("Filtered searching should have found some matches", hits.length > 0); for (int i = 0; i < hits.length; i++) { Document d = searcher.doc(hits[i].doc); String url = d.get(KEY_FIELD); TermDocs td = reader.termDocs(new Term(KEY_FIELD, url)); int lastDoc = 0; while (td.next()) { lastDoc = td.doc(); } assertEquals("Duplicate urls should return last doc", lastDoc, hits[i].doc); } }

    Read the article

  • Dynamic WebService implementation

    - by chardex
    I have a set of different interfaces and I need to give them access via web services. I have implemented this task in .NET as follows: dynamically generated interface implementation on the IL, marked methods with WebMethod annotation, and in *.asmx handler called generated stub. More needs to be able to change the method signatures (eg change the type of certain argument or add new arguments), ie not always explicitly implement an interface, and use it as a decorator pattern. Example: interface ISomeService { void simpleMetod (String arg1); void customMetod (CusomType arg1, Integer arg2); } // Need to dynamically generate such class @WebService class SomeWebService { private ISomeService someService = new SomeServiceImpl (); @WebMethod public void simpleMethod (String arg1) { someService.simpleMethod (arg1); } @WebMethod public void customMethod (String arg1, Integer arg2) { someService.customMethod (CusomType.fromString (arg1), arg2); } } Interfaces such as ISomeService quite a lot. And manually write code like this I don't want. I work with Java recently, what technology/libraries should be used to solve such task. Thanks.

    Read the article

1