This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.lucene.analysis.*; | |
import org.apache.lucene.analysis.core.WhitespaceTokenizer; | |
import org.apache.lucene.analysis.miscellaneous.DelimitedTermFrequencyTokenFilter; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.document.Field; | |
import org.apache.lucene.document.FieldType; | |
import org.apache.lucene.index.*; | |
import org.apache.lucene.search.IndexSearcher; | |
import org.apache.lucene.search.MatchAllDocsQuery; | |
import org.apache.lucene.search.TopDocs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Usage: | |
## $ chmod +x fetcher.sh | |
## $fetcher.sh <output file> | |
SOLR_URL="http://localhost:8983/solr" | |
COLLECTION="teste" | |
ROWS=10 | |
FL=*,score # No space around commas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Python implementations of the search relevance evaluation metrics described at | |
## https://opensourceconnections.com/blog/2020/02/28/choosing-your-search-relevance-metric/ | |
## | |
## | |
def precision(docs): | |
return sum(docs) / len(docs) if docs else 0 | |
def avg_precision(docs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import secrets | |
import sys | |
from hashlib import sha256 | |
from base64 import b64encode, b64decode | |
## | |
## Based on the logic here: https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/security/Sha256AuthenticationProvider.java |
OlderNewer