Solr - ignore dots, dashes, slash, leading zeros - search

I want to know if it's possible to accomplish the following results with Apache Solr and how. Which filters do I need to use?
If I search:
search results
1.000 1000 or 1.000 (ignore dot in numbers)
007 7 or 007 (ignore leading zeros)
wi-fi wifi or wi-fi (ignore dash)
123/456 123 456 or 123/456 (ignore slash)
something some or someone or something (similar words)
And is it possible to do this without a specific field?
Like in a simple search that I don't use a metadata to search for.
I need that it works in both cases.
Thank you in advance.

Related

Regex hyphen causing issues

I'm trying to use python to extract invoice info from a text file. The items always start with a quantity (1 x, 2 x, etc) and end with a part number, for various reasons the descriptions can differ even for the same item. The following regex seems to pull out most of the entries, but fails when there is a hyphen '-' in the description.
Regex:
^([0-9]+\sx) [\w\s\r\n®.,]* [0-9]{3}-\d[A-Z]\d+(-AB)?
I'm struggling to work out how to modify the regex to deal with this. I though adding (\s-\s) in would help, but the regex then seems to match parts of different entries rather than the individual ones. I'm sure there are more efficient ways of writing the regex, but I don't use them that often, so getting this far was an achievement. Any pointers gratefully received.
Example entries shown below. With the above regex, the middle one doesn't get matched unless I delete the '-'
1 x Product® 100, Low range items
3,456.00 USD
Cat. No. 012-3A45
1 x Product® 100. Low range items - LRI
123,456.00 USD
Part. no. 201-5G95
2 x Product Mid Range Items
7,654.00 USD
Art. no. 001-8Q147-AB
You can add a hyphen and make the pattern non greedy
^([0-9]+\sx) [-\w\s®.,]*? [0-9]{3}-\d[A-Z]\d+(-AB)?
Regex demo
Note that \s also matches a newline.

How to search with a criteria in sublime?

in sublime if you want to search for a string "apple" but not "apple."
How do you do that?
Thank you all.
I heard somewhere you can add a - to substract unwanted hit but don't know where to put it.
With regular expression, you can use:
\bapple(?!\.)
Where (?!\.) is a negative lookahead that make sure we haven't a dot after apple and \b is a word boundary to be sure to not match pinapple

How to search phone number from mongodb by any format using angular 8

want to search data from db but data saved in any format like this inputs like any format numbers in between slash or dash or space how to commonly search records can anyone tell how to search like this records(800) 123 1234 , 800-100-1000

Excel: sorting alphabet with diacritics

I have a list of vocabulary in Excel in a given language.
The thing is, this language has four diacritical letters: č ǧ š ț, which are letters on their own and are placed after their respective 'mother characters', but Excel ignores them and mixes up diacritic and non-diacritic versions.
So for example I have:
sete
ši
sieta
When it should be:
sete
sieta
[...]
suona
šconda
[...]
ši
How can I solve this?
Thanks in advance.
A workaround that might do the trick is to put the letters in a separate table that has 2 columns - letter and sort number.
Then create a helper sort column that looks up the table to give you a sort using vlookup / index match. If it is applicable you might also want to add the remaining characters to make the sorting more accurate.
It will be sorted correctly if your windows reginal settings are set for your country.

excel formula to put different values if different strings in cell

I have words coded within daily notes
These are like diary entries with coding at the end...
I took some advil today,tired=.5,headache=.75, etc
rode a bike for 3 hours,tired=.75,headache=.75, etc
Can I write a formula that can search for the phrase tired=.5 or tired=.75 and put the .5 or .75 in the cell. There are only 4 possibilities for levels .25,.5,.75, and 1. If it doesn't find a statement for tired it should give back 0.
This works for absolute phrase matches.
=IF(A1="tired=.75",.75),IF(A1="tired=.5",.5),IF(A1="tired=.25",.25)
but I'm not sure how to use search to do the same thing.
Here is my failed attempt at using search.
=IF(ISNUMBER(SEARCH("tired=.75",B1484)),0.75,0),IF(ISNUMBER(SEARCH("tired=.25",B1484)),0.25,0)
I think this will do it:
=VALUE(MID(A1,SEARCH("tired=",A1)+6,FIND(",",(MID(A1,SEARCH("tired=",A1),12)))-6-1))
No reason to use IF statements, just FIND and convert the text directly. I mix FIND and SEARCH here, you can use one or both as you prefer (FIND is case sensitive, SEARCH is not).

Resources