question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accuracy suffix/prefix options

See original GitHub issue

This is feature request.

My case is simple: I perform search on prefixes of words in the index and so I would like to highlight only matches which are prefixes (not in the middle of word). Example:

query: “fix” text: “fix fixes prefix” result: “fix fixes prefix” “fix” in “prefix” is not highlighted because it is not prefix of “prefix” 😉

Solution: it is enough to support new value of ‘accuracy’ configuration option (I called it ‘prefix’) and support it with addition of following code to ‘createAccuracyRegExp(str)’ function:

    case "prefix":
        return "(^|\\s" + lsJoin + ")(" + str + ")";

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
whurycommented, Mar 7, 2017

@patrickf3139 You can see appropriate changes in my fork.

1reaction
whurycommented, Mar 7, 2017

@julmot What you describe is exactly my use case - I have full-text search results and I want to highlight all matching prefixes (and only prefixes) of all words in the text (not one per line/div etc.). Note that this is similar and agrees with existing accuracy options - same approach to words, only matching logic is different:

  • “exact” - matches only exactly same words,
  • “partially” - matches any part of any word,
  • “prefix” - matches only prefixes of words. If one “would expect one ‘Lorem’ match per line (div)”, then it would be completely different logic - but this is not the case!

@patrickf3139 I have my changes in local repository. If you are interested, I will fork the project and apply my changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Easy guide to know whats a prefix and whats a suffix? - Reddit
Fairly new to the game and I see a lot of guides mentioning to look for certain items with open prefix and or...
Read more >
Prefixes, and Suffixes: Words, Worksheets, & Activities
All the prefixes and suffixes worksheets you need: an evidence-based way to teach morphology of words and improve semantics in speech ...
Read more >
Modifiers - Path of Exile Wiki - Fandom
May be randomized (such as prefixes, suffixes) or fixed (e.x. on unique items). ... modifiers such as #% increased Physical Damage, +# to...
Read more >
Prefix/Suffix for Dimension Types (What's New in 2022)
Customize dimensions to meet your documentation needs by adding a prefix, suffix, or both to a dimension type.
Read more >
Number formatters — number_format • scales
All formatters allow you to re- scale (multiplicatively), to round to specified accuracy , to add custom suffix and prefix and to specify...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found