-
Notifications
You must be signed in to change notification settings - Fork 102
Tips for working with Quepid
Eric Pugh edited this page Apr 25, 2022
·
30 revisions
- Did you know you can add multiple queries at once by separating them with a
;
character? Go ahead and try outstar wars;star trek
in the Add Query field. - When importing CSV files with special characters like á, make sure to use UTF-8 encoding.
- You can add a thumbnail image to each document result via
thumb:poster_path
, this assumes you have the full url in the fieldposter_path
in your document. You can add a larger image viaimage:poster_path
. If you have a RELATIVE url, then you can specify your http root via some json:{"name": "poster_path", "type":"image", "prefix": "https://www.example.org/images"}
in place ofimage:poster_path
. - If you have an audio/image/video URL, you can embed in in the result listing via
media:field_name
- Sometimes you need to look at the original document. If your field value starts with the string
http
orhttps
then it will be turned into a clickable link. - Want to see the output of a function as a field? Just add the function name to the field list, like
id title geodist()
and the function will run. Sadly, aliasing field names isn't supported, likedistance:geodist()
. - Do you have a nested JSON document in your results like
{ "variants": [ { "name": "red" }, { "name": "blue" } ] }
? Specify your field asvariants.name
and it will pluck out the values red,blue from the array. If you have{ "actor": { "name": "bob hope", "id":52 } }
you can doactor.name
to just get the name. - If you ever run into a situation with Quepid refusing to start / respond due to
Unknown database: 'quepid'
, and you are using docker, it might be that the mysql database is not stored on the volume in the expected location (volumes/mysql_data/quepid
) on your disk. Instead, it can be inside the docker image that had been running Quepid instance last. So, if you are not an expert in docker (like me), you can try your luck by grep'ingquepid
in/var/lib/docker/volumes/
. Something like this should do:grep -r quepid /var/lib/docker/volumes/
. If grep outputs some files likequepid/
, take a note of the path, cd in there and observe the directory. It should have the files like:ib_logfile1 performance_schema/ auto.cnf mysql/ ib_logfile0 ibdata1 quepid/
Copy these files and directories into the expected location likevolumes/mysql_data/quepid
and start your quepid application with mysql and redis.
A crazy use of a custom scorer is to change the Quepid UI! Since a Custom Scorer is JavaScript, it can manipulate the actual Quepid site!
Here is an example of making a relative URL that is in your search engine document a fully qualified URL:
window.onclick = function(event) {
if(event.target.classList.contains('toggleSign') || event.target.classList.contains('query')) {
var url;
$(".subLabel").each(function(){
console.log("Here we are:" + $(this).text());
if($(this).text().indexOf("relative_image_url") > -1 ) {
url = $(this).next().text();
if(url !== undefined && url.indexOf("http") == -1) {
$(this).next().html("<a target='_blank' href='https://i.imgur.com" + url +"'>https://i.imgur.com" + url + "</a>");
}
}
});
}
};
Here is an example of modifying the image thumbnail to provide a full link!
window.onclick = function(event) {
//console.log(event.target.classList);
if(event.target.classList.contains('toggleSign') || event.target.classList.contains('query')) {
var imgUrl;
$(".img-thumbnail").each(function(){
imgUrl = $(this).attr("src");
if(imgUrl !== undefined && imgUrl.indexOf("http") == -1)
{
$(this).attr("src", "https://i.imgur.com" + $(this).attr("src"));
}
});
}
};
There are some blog posts that you may find valuable as well:
- Custom Scorers Howto
- How to write your own NDCG scorer - Great for learning how to write scorers! NDCG@10 now ships as default with Quepid.
- Quepid Carries Your Caseload
- How to compare Legacy Search Results to Current Search in Quepid
- Introducing the Show Only Rated toggle in Quepid
- How to write a Unit Tests against Search Results