Can't search products in magento 2 - search

When i try to search a product it show nothing. And i check the exception, it show some bug
[2018-10-06 01:42:56] main.CRITICAL: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list, query was: SELECT search_synonyms.* FROM search_synonyms WHERE (MATCH (synonyms) AGAINST ('greene tweed n038406502sd653 o ring 2560 id x 0151 cx in' IN BOOLEAN MODE)) [] []
[2018-10-06 01:42:56] main.CRITICAL: SQLSTATE[HY000]: General error: 1191 Can't find FULLTEXT index matching the column list, query was: SELECT search_synonyms.* FROM search_synonyms WHERE (MATCH (synonyms) AGAINST ('greene tweed n038406502sd653 o ring 2560 id x 0151 cx in' IN BOOLEAN MODE)) [] []

ALTER TABLE search_synonyms ADD FULLTEXT (synonyms);
Try this to add a full text index.

Related

Remove leading dollar sign from data and improve current solution

I have string like so:
"Job 1233:name_uuid (table n_Cars_1234567$20220316) done. Records: 24, with errors: 0."
I'd like to retieve the datte from the table name, so far I use:
"\$[0-9]+"
but this yields $20220316. How do I get only the date, without $?
I'd also like to get the table name: n_Cars_12345678$20220316
So far I have this:
pattern_table_info = "\(([^\)]+)\)"
pattern_table_name = "(?<=table ).*"
table_info = re.search(pattern_table_info, message).group(1)
table = re.search(pattern_table_name, table_info).group(0)
However I'd like to have a more simpler solution, how can I improve this?
EDIT:
Actually the table name should be:
n_Cars_12345678
So everything before the "$" sign and after "table"...how can this part of the string be retrieved?
You can use a regex with two capturing groups:
table\s+([^()]*)\$([0-9]+)
See the regex demo. Details:
table - a word
\s+ - one or more whitespaces
([^()]*) - Group 1: zero or more chars other than ( and )
\$ - a $ char
([0-9]+) - Group 2: one or more digits.
See the Python demo:
import re
text = "Job 1233:name_uuid (table n_Cars_1234567$20220316) done. Records: 24, with errors: 0."
rx = r"table\s+([^()]*)\$([0-9]+)"
m = re.search(rx, text)
if m:
print(m.group(1))
print(m.group(2))
Output:
n_Cars_1234567
20220316
You can write a single pattern with 2 capture groups:
\(table (\w+\$(\d+))\)
The pattern matches:
\(table
( Capture group 1
\w+\$ match 1+ word characters and $
(\d+) Capture group 2, match 1+ digits
) Close group 1
\) Match )
See a Regex demo and a Python demo.
import re
s = "Job 1233:name_uuid (table n_Cars_1234567$20220316) done. Records: 24, with errors: 0."
m = re.search(r"\(table (\w+\$(\d+))\)", s)
if m:
print(m.group(1))
print(m.group(2))
Output
n_Cars_1234567$20220316
20220316

Failing to use sumproduct on date ranges with multiple conditions [Python]

From replacement data table (below on the image), I am trying to incorporate the solbox product replace in time series data format(above on the image). I need to extract out the number of consumers per day from the information.
What I need to find out:
On a specific date, which number of solbox product was active
On a specific date, which number of solbox product (which was a consumer) was active
I have used this line of code in excel but cannot implement this on python properly.
=SUMPRODUCT((Record_Solbox_Replacement!$O$2:$O$1367 = "consumer") * (A475>=Record_Solbox_Replacement!$L$2:$L$1367)*(A475<Record_Solbox_Replacement!$M$2:$M$1367))
I tried in python -
timebase_df['date'] = pd.date_range(start = replace_table_df['solbox_started'].min(), end = replace_table_df['solbox_started'].max(), freq = frequency)
timebase_df['date_unix'] = timebase_df['date'].astype(np.int64) // 10**9
timebase_df['no_of_solboxes'] = ((timebase_df['date_unix']>=replace_table_df['started'].to_numpy()) & (timebase_df['date_unix'] < replace_table_df['ended'].to_numpy() & replace_table_df['customer_type'] == 'customer']))
ERROR:
~\Anaconda3\Anaconda4\lib\site-packages\pandas\core\ops\array_ops.py in comparison_op(left, right, op)
232 # The ambiguous case is object-dtype. See GH#27803
233 if len(lvalues) != len(rvalues):
--> 234 raise ValueError("Lengths must match to compare")
235
236 if should_extension_dispatch(lvalues, rvalues):
ValueError: Lengths must match to compare
Can someone help me please? I can explain in comment section if I have missed something.

ArangoDB AQL: LOWER not working for value of slice?

I try following :
FOR d IN cresume FILTER d.isActive==true AND d.isPublic==true AND 'javascript' IN LOWER(d.resume.skills[*].name) SORT d.activatedTS DESC LIMIT 200 RETURN d
idea is to check if (lowercase) javascript is in skills[*] name. This don't find Result. If I do:
FOR d IN cresume FILTER d.isActive==true AND d.isPublic==true AND 'JavaScript' IN d.resume.skills[*].name SORT d.activatedTS DESC LIMIT 200 RETURN d
I get the result
Question... Is LOWER not working on a value from an [*] Array/Slice ?
Got info from Arango Support. As documented, LOWER works on strings. But instead of LOWER(d.resume.skills[*].name) you can use d.resume.skills[* RETURN LOWER(CURRENT.name)]

how could I make list of lists from neo4j record

I am facing list manipulation from loop iteration. I am trying to populate a list from Neo4j record
myquery="""MATCH (c :Customer {walletId:$item})-[:MR|:SENDS_MONEY]-(d)-[:PAYS]->(m)
WHERE NOT (c)-[]-(m)
RETURN c.walletId, m.walletId, m.name, COUNT(m.name) ORDER BY COUNT(m.name) DESC LIMIT 30"""
result=graphdbsessionwallet.run(myquery,item=item)
#print(result)
for record in result:
print(list(record))
and my current result is
['01302268120', '01685676658', 'Shojon Medical Hall', 6]
['01302268216', '01733243988', 'APEXFOOTWEAR LIMITED', 1]
and so on
desired
[['01302268120', '01685676658', 'Shojon Medical Hall', 6],['01302268216', '01733243988', 'APEXFOOTWEAR LIMITED', 1]]
I want to put this lists into one list , kindly help me to solve this
You can modify your query to return the list with the help of COLLECT clause:
MATCH (c :Customer {walletId:$item})-[:MR|:SENDS_MONEY]-(d)-[:PAYS]->(m)
WHERE NOT (c)-[]-(m)
WITH c, m, COUNT(m.name) as cnt
ORDER BY cnt DESC
RETURN COLLECT([c.walletId, m.walletId, m.name, cnt])
LIMIT 30

If Cell Starts with String from a List Return Number

What I am looking for is either a formula or Macro/code that will allow me to do the following:
I have a list of the beginning of Postcodes, for example, "AB31, AB32, AB33, AB34", I need something that will return a value of 313 if the start of a cell contains a value from this list I have, and a value of 74 if it does not start with a value from that list.
Now the list is quite long, theres probably 100+ values in there. If there weren't so many values in the list I could use something like
=IF(LEFT(K1,4)="AB51","313","72")
The Postcode will be in the K column, and the full list I need it to search through is
AB31
AB32
AB33
AB34
AB35
AB36
AB37
AB38
AB40
AB41
AB42
AB43
AB44
AB45
AB46
AB47
AB48
AB49
AB50
AB51
AB52
AB53
AB54
AB55
AB56
BT
GY
HS
IM
IV1
IV2
IV3
IV4
IV5
IV6
IV7
IV8
IV9
IV10
IV11
IV12
IV13
IV14
IV15
IV16
IV17
IV18
IV19
IV20
IV21
IV22
IV23
IV24
IV25
IV26
IV27
IV28
IV30
IV31
IV32
IV36
IV40
IV41
IV42
IV43
IV44
IV45
IV46
IV47
IV48
IV49
IV51
IV52
IV53
IV54
IV55
IV56
IV63
J3
KA27
KA28
KW1
KW2
KW3
KW4
KW5
KW6
KW7
KW8
KW9
KW10
KW11
KW12
KW13
KW14
KW15
KW16
KW17
PA20
PA21
PA22
PA23
PA24
PA25
PA26
PA27
PA28
PA29
PA30
PA31
PA32
PA33
PA34
PA35
PA36
PA37
PA38
PA41
PA42
PA43
PA44
PA45
PA46
PA47
PA48
PA49
PA60
PA61
PA62
PA63
PA64
PA65
PA66
PA67
PA68
PA69
PA70
PA71
PA72
PA73
PA74
PA75
PA76
PA77
PA78
PH4
PH5
PH6
PH7
PH8
PH9
PH10
PH11
PH12
PH13
PH14
PH15
PH16
PH17
PH18
PH19
PH20
PH21
PH22
PH23
PH24
PH25
PH26
PH27
PH28
PH29
PH30
PH31
PH32
PH33
PH34
PH35
PH36
PH37
PH38
PH39
PH40
PH41
PH42
PH43
PH44
PH49
PH50
TR21
TR22
TR23
TR24
TR25
ZE
So if any Postcode in column K begins with any of those values, I would like the number 313 returning, if not the number 72 returning.
Any help would be much appreciated.
Thanks!
You should give example on how your sheets look like or else it is very difficult to answer.
what I will do
Put the list on a Column
Use combination of IF and Vlookup to loop through the list.
=IF(VLOOKUP(LEFT(K1, 4),A:A,1,0)=LEFT(K1, 4),313,72)
Column E Column F Column G
Post Code Result Formula
AB31456 313 =IF(VLOOKUP(LEFT(E2,4),A:A,1,0)=LEFT(E2,4),313,72)
KZ12398 72 =IF(VLOOKUP(LEFT(E2,4),A:A,1,0)=LEFT(E2,4),313,72)

Resources