![]() Subclass DefaultSimilarity and override the method you want to customize. Its easy to customize the scoring algorithm. Hint: look at NutchSimilarity in Nutch to see an example of how web pages can be scored for relevance The mathematical definition of the scoring can be found at here * Documents which mention the search terms many times are good * Long documents are not as good as short ones * Matches on rare words are better than for common words A Principal Data Scientist/Manager with nearly a decade of experience in exploring, analyzing, and researching financial, real-estate, and user behaviour data to procure insights, prescribe recommendations, build models, design experiments and deploy scalable machine learning applications. * Documents containing *all* the search terms are good So, in summary (quoting Mark Harwood from the mailing list), Uncover property values, resident history, neighborhood safety score, and more 56 records found for Apache Ln, Crosby, TX 77532. It is implemented as 1/sqrt(sumOfSquaredWeights) Find out who lives on Apache Ln, Crosby, TX 77532. QueryNorm is not related to the relevance of the document, but rather tries to make scores between different queries comparable. Rationale: a term in a field with less terms is more important than one with more Implication: a term matched in fields with less terms have a higher score Implication: of the terms in the query, a document that contains more terms will have a higher score Rationale: common terms are less important than uncommon ones Implication: the greater the occurrence of a term in different documents, the lower its score Implementation: log(numDocs/(docFreq+1)) + 1 Rationale: documents which contains more of a term are generally more relevant Implication: the more frequent a term occurs in a document, the greater its score Note: the implication of these factors should be read as, "Everything else being equal. The implementation, implication and rationales of factors 1,2, 3 and 4 in DefaultSimilarity.java, which is what you get if you don't explicitly specify a similarity, are: boost (query) = boost of the field at query-time.boost (index) = boost of the field at index-time.queryNorm = normalization factor so that queries can be compared.If you want to find the document entitled 'The Right Way' which contains the text 'dont go this way', you can enter: title:'The Right Way' AND text:go. lengthNorm = measure of the importance of a term according to the total number of terms in the field As an example, lets assume a Lucene index contains two fields, title and text and text is the default field.coord = number of terms in the query that were found in the document.idf = inverse document frequency = measure of how often the term appears across the index Starting with the basics of Lucene and searching, you will learn about the types of queries used in it and also take a look at scoring models.tf = term frequency in document = measure of how often a term appears in the document.The factors involved in Lucene's scoring algorithm are as follows: ![]() Lucene implements a variant of the Tf-Idf scoring model. The authoritative document for scoring is found on the Lucene site here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |