Skip to content

Scene Searching in XBVR

toshski edited this page Jan 2, 2024 · 2 revisions

XBVR uses Bleve, a 3rd party package to provide search functionality used by the Quick Find and File Matching, specifically it's "Query String Query". We Index the Scene-Id, Title, Description, Cast, Duration, Site, Date Release and Date Added fields from the scene.

When you search for Making Up Is Hard To Do, you are probably wanting scenes with the title Making Up Is Hard To Do, right. But that not what search engines do, you may not have it exactly right and the same scene from different sites can have a different name. Some here some things to consider with a typical search like that:

  • it will search for any of those words, in any of the fields we indexed
  • not all words have to exist
  • other words can exist
  • common words are usually ignored, eg is, to, do and maybe up. That means the example given is only searching for Making and Hard. The Title and Cast fields are an exception to this, they include common words
  • no field is more important than another, while you are naturally most interested in the title, a match in the description is of equal importance

Ranking Results

  • scenes are ranked based on their score, which is the sum of scores for individual aspects of the search process
  • rare words have a score higher than commonly occurring words
  • the score increases the more a occurs, ie if Hard occurs 5 times in any field in one scene, it score will be higher than if it only occurred twice
  • a match in short text will score higher than long text, ie the score for matching the same word in a description with 10 words and a description with 100 words will be different
  • the scene scores used for ranking only have meaning for that query. Running the same query a month later could give different results. The scores are only relavant to other scenes in that query. A score from one query of 10 doesn't mean it is a better match than a score of 7 in another query.
  • and a whole bunch of other things

Tailoring Queries

You can search for a word in a specific field by prefixing it with the field name, the prefix will only apply to the next word. eg title:Making searches for the word Making specfically in the Title. To search for multiple words, prefix each word or wrap them in double quotes. Field prefixes you can use are

id title site cast duration description released added

While all fields have equal importance, boosting allows you to overide the default boost factor for a field, specify a ^ followed by the boost value eg title:Making^2. By default every field has a boost value of 1 (duration for some reason does seem to be able to be changed). So if you want to make Title more important and Description less important than Duration you could set the Title to 2, and Description to 0.5

To specify something MUST match then add a + at the begining of the field, eg title:Making^2 will increase the score of scenes with Making in the title, but the results can still include scenes without Making in the title. +title:Making^2 will only return scenes with Making in the title. I think a - will mean they must not included it.

You can search for dates and number < or > than a value, but if they must be < or > prefix the field with a +. ie if search for duration:<10 you could still get a scene with a duration of 11, it will just now be scored lower. But +duration:<10 should only include durations less than 10.

Examples

Search Description
Making Up Is Hard To Do Searches for any of the words in any field, ignoring common words in some fields
title:Making Up Is Hard To Do Searches for Making in the title and Up Is Hard To Do in any field
title:"Making Up" Searches for Making Up in the title
title:"Making Up"^1.5 Searches for Making Up in the title and increase the scoring for a match
title:Making title:Up^ Searches for Making and Up in the title. Note, both words don't have to exist and if both do, the order of the words has no relavance
title:Making^2 title:Up"^0.5 Same as above, but also increases scoring of Making and decreases scoring for Up
+title:"Making Up" Making Up must be in the title, boosting is therefore not relevant

Additional Information

You can display what values a scene's search indexes has by turning on the Search Fields Tab visiable in the Scene Details overlay. Enable in Options/Advance/Scene Details/show Search Field

For more details on Bleve, refer to the official documentation: Bleve Query String Query.