Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter antonywalton

    (@antonywalton)

    Fast work! 😉

    I’ve commented that line out of lib/indexing.php and rerun the indexer. The debug now lists more tokenised terms as:

    ±0.1 ±30 0.001 0.1 0.2 100 10nh 10w 140 2000hrs 500m 500v 81a air allow aluminium ambient applicable applications available capabilities connection connections constant current degreesc depending designed deviation dielectric easy equipment free handling heat heating heatsink high hole include inductance isabellenhütte kelvin laboratories laboratory low maximum measurement measurements mounting offers ohms options permanent power ppm precision pulse range rating reference required resistance resistor resistors rth rthi select self sensing series sink sources specification stability substrate suitable supplies table tcr technology temperature terminal thermal tolerance typical value values voltage withstanding

    So that’s way better, thanks.

    Using the filter code snippet and checking the debug for the product under discussion has a couple of different results, depending on where the character appears.

    Taxonomy
    There are indeed taxonomy terms with the Ω symbol present, in the debug these are shown to be replaced for the lowercase version of the character; ω. Is it useful to know which taxonomy is affected?

    Other taxonomies (with the relevanssi_punctuation_filter active):

    ±0.1 ±30 0.001 0.001ω 0.005ω 0.01ω 0.02ω 0.05ω 0.1 0.1ω 0.25ω 0.2ω 0.3ω 0.5ω 1.0 100 100r 100ω 10r0 10w 140 1r00 33r0 33ω 5r00 81a ah1 compliant components control current degreesc electronic hole instrumentation isabellenhuette low measurement ohms power ppm r001 r005 r010 r020 r050 r100 r200 r250 r300 r500 resistance resistor resistors scientific sensing terminal test

    As ‘ohms’ does appear in this token list, is the replacement actually happening and I’m just misreading the token list? My expectation would be to not see any ω characters.

    Content
    General content terms have the target replacements stripped out and disappear from the list of tokens. Is this the correct behaviour? This is shown in the content debug code above.

    Content terms that should have ‘ohms’: 100Ω, 0.001Ω, 500mΩ, 1mΩ (it looks like due to the Ω being stripped out, this term falls below the min word length limit).

    Hope this info helps.

    Thread Starter antonywalton

    (@antonywalton)

    Hi Mikko,

    Thanks for the reply, that make sense about the non-repeated tokens. We’re using version 4.11.0 of Relevanssi. Does this have the better tokeniser? Min word length is set at the default, I think I remember seeing a setting for this at 3?

    If this is the latest version, I need to look at something else going on with the tokenisation?

    Thanks also for the replacement ohms filter, it looks fairly similar to some example code I found and adapted:

    add_filter( 'relevanssi_punctuation_filter', 'rlv_character_equivalency' );
    function rlv_character_equivalency( $array ) {
    	$array['ω'] = 'ohms';
    	$array['Ω'] = 'ohms';
    	return $array;
    }

    In the Relevanssi debug tab, the majority of the ohms entries, which haven’t been replaced by the filter, are listed under ‘Other taxonomies’ heading. Should I be using a slightly different filter for these? For the ° symbol, I might end up replacing it with something like ' degrees'. Also, should I move this specific issue into a new forum thread?

Viewing 2 replies - 1 through 2 (of 2 total)