Ejemplo n.º 1
0
 public ResourcesApiController(IResourcesCommand resourcesCommand, IResourcesQuery resourcesQuery, IPollsCommand pollsCommand, IPollsQuery pollsQuery)
 {
     _resourcesCommand      = resourcesCommand;
     _resourcesQuery        = resourcesQuery;
     _pollsCommand          = pollsCommand;
     _pollsQuery            = pollsQuery;
     ControllerNameOverride = "Resources";
 }
Ejemplo n.º 2
0
        public void ResourceSearchTestsInitialize()
        {
            _resourcesQuery   = Resolve <IResourcesQuery>();
            _resourcesCommand = Resolve <IResourcesCommand>();
            _faqsQuery        = Resolve <IFaqsQuery>();
            _indexer          = new Indexer(new SimpleAnalyzer(), new SimpleAnalyzer(), new ResourceSearchBooster(), _resourcesQuery, _faqsQuery);

            _indexWriter = new IndexWriter(new RAMDirectory(), null, IndexWriter.MaxFieldLength.UNLIMITED);
            var similarity = new SweetSpotSimilarity();

            similarity.setLengthNormFactors(FieldName.Content, 200, 1000, 0.5f, false);
            _indexWriter.setSimilarity(similarity);
        }