PDA

View Full Version : Still not searching product reference field


JMK2
14-Nov-2003, 09:30 PM
I followed the instructions in the KB and added the '-' character to the list of search characters. Then I did a site update. However, if I search for this term in the product reference field it does not show:

CR-AS-CD-S520

Do I need to try a refresh perhaps, or is there some other reason I cannot search on product reference?

JMK2
14-Nov-2003, 11:41 PM
The refresh did help and now I can get a result by entering the complete product reference text. However, it is necessary to find the prod reference "NC-AS-A7V600" by entering only "A7V600". At the moment I can only get a result by entering "NC-AS-A7V600" and not "A7V600".

I've looked at the advanced manual but cannot seem to find out how to make it give me a search result on a partial prod reference term.

rmladden
15-Nov-2003, 12:22 AM
Actinic only does partial matching on the beginning of a word. Since it seems that it is the last part of the reference that is most significant, I would try taking the - out of the search list of search characters and strip all but the last part of the reference out of the search string. You would key on the -. Words without a - would not be affected. It would take a few tries to get the right regular expression in the s/// Perl function. I was never good at that. You would put the code above the line:
# Combine any multiple-white-spaces into single space:
in search.pm
I played with this to handle plurals. See my post at http://community.actinic.com/showthread.php?s=&threadid=3974

rmladden
15-Nov-2003, 12:35 AM
I have not tested this at all, but try this line:
$$psSearchString =~ s/\w*-//io;

It will probably need adjusting. I hate regular expressions.

JMK2
15-Nov-2003, 12:37 AM
Thanks Bob,

I'm afraid that I'm having a bit of a problem following those instructions. It looks like I need to edit the PERL file after I modify the source csv file to have spaces instead of "-"? Or perhaps I'm to just strip the "-" and make the product reference into one word.

I can't really parse the product references in the source csv file as it is updated daily from an external supplier and contains 4000 items without building a whole pile of append queries, export queries, and macros, and then scheduling them in access.

rmladden
15-Nov-2003, 12:40 AM
You do not have to edit the CSV file at all. This trick only effects searching.

JMK2
15-Nov-2003, 12:46 AM
OK, I'll try adding that string to the search.pm file and see what happens, thanks.

rmladden
15-Nov-2003, 01:00 AM
Good luck. You may need to modify the line. These expressions are hard to get right on the first try. Turn on search recording (see the advanced user guide) to see what the string gets changed to.

JMK2
15-Nov-2003, 01:08 AM
Thanks Bob,

I see you sell Science kits. We used to buy and resell similar electronic kits from a fellow in Hong Kong (he was a Brit expat) called DIY electronics. I still have a few kicking around here. My favourites were the bug kits, which we used to place in the boss's truck so he could not sneak up on us while we were trying to get some hard earned rest. (Q: What's brown and sleeps 2? A: A Park Warden truck).

JMK2
15-Nov-2003, 01:55 AM
You mention that I may have to play with it. Not having any experience with PERL, not sure what it should do in order to adjust that line to try other things. But I'm just refreshing the site now and we'll see what happens. Thanks.

Did a refresh and then tested it, seems not to have changed anything.

rmladden
15-Nov-2003, 02:40 AM
Turn on search recording. Enter lots of strings and see what is recorded. Then post them here.

Also did you take the - out of the list of search characters?

rmladden
15-Nov-2003, 02:53 AM
I said I hate regular expressions! :eek:

Try this line:
$$psSearchString =~ s/(\w*-)+/ /io;

This will change CR-AS-CD-S520 to S520

Then if you take the - out of the search list of search characters it should find a match on S520. Not perfect, but it would be as close as we can get.

BTW, I sell a few of the DIY kits.

rmladden
15-Nov-2003, 02:57 AM
I had a typo that I corrected in the line. Be sure it is
$$psSearchString =~ s/(\w*-)+/ /io;

JMK2
15-Nov-2003, 03:29 AM
I forgot to take the "-" out, I did it and inserted your corrected string and then refreshed the site. No Luck. How do I turn that recording on? Did not see it in the search settings.


That's amazing you have those kits. The fellow that made them did it from a tiny flat in Shamshuipo in HK, I've actually been to his place. I wonder what ever happened to him? We never had much luck selling the kits even though we advertised them in electronics mag's. Small world.

rmladden
15-Nov-2003, 03:36 AM
See page 56 of the advanced user guide. Post the results here.

JMK2
15-Nov-2003, 04:22 AM
Thanks Bob,

Unfortunately I cannot proceed due to another error which I just posted.

JMK2
15-Nov-2003, 05:10 AM
For some reason I had to rename all my image files in the database and the folder they were in before I could update. Surely that is not a requirement for each update that the images files have to be changed each time.

Anyway, here is the log file results:
Version: 6
Date, Remote host, Customer ID, Buyer ID, Search words
2003/11/15 06:03, 205.206.127.196, 0, 0, "p4p800s"
2003/11/15 06:03, 205.206.127.196, 0, 0, " a7v600 "
2003/11/15 06:04, 205.206.127.196, 0, 0, "a7v600"

This is how they are in the database:
NC-AS-P4P800S
NC-AS-A7V600

rmladden
15-Nov-2003, 12:24 PM
The change is working, but it is acting as if the - is still in the search word character set.
Delete all the .fil files on the server and refresh again (not an update).
I don't understand your other error.

My word character set is:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'0123456789ŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ

JMK2
15-Nov-2003, 04:31 PM
Ah, looking at the log, now I see what you mean about it working after I had some sleep. I'll go back through everything and give it a try.

Thanks Bob

JMK2
17-Nov-2003, 12:08 AM
Well, it appears to be removing the "-" OK, but it will not return any results at all now, even if I place the entire search string in there (possibly because I removed "-" from the list?).

I've removed those .fil pages and refreshed, and made sure that the "-" is not in the list.

This is the expression that is currently in Search.pm:
$$psSearchString =~ s/(\w*-)+/ /io;

:(

Version: 6
Date, Remote host, Customer ID, Buyer ID, Search words
2003/11/15 06:03, 205.206.127.196, 0, 0, "p4p800s"
2003/11/15 06:03, 205.206.127.196, 0, 0, " a7v600 "
2003/11/15 06:04, 205.206.127.196, 0, 0, "a7v600"
2003/11/15 06:10, 205.206.127.196, 0, 0, "a7v600"
2003/11/15 06:11, 205.206.127.196, 0, 0, "neo tech negative"
2003/11/15 21:54, 64.230.63.187, 0, 0, "solar cells"
2003/11/17 00:16, 205.206.127.196, 0, 0, "a7v600"
2003/11/17 00:16, 205.206.127.196, 0, 0, " a7v600"
2003/11/17 00:17, 205.206.127.196, 0, 0, "kt600"
2003/11/17 00:25, 205.206.127.196, 0, 0, "nimh"
2003/11/17 00:51, 205.206.127.196, 0, 0, "33l5151"
2003/11/17 00:51, 205.206.127.196, 0, 0, "cr ib nb 33l5151"
2003/11/17 00:52, 205.206.127.196, 0, 0, "cr ib nb 33l5151"
2003/11/17 00:52, 205.206.127.196, 0, 0, " cr ib nb 33l5151 "
2003/11/17 00:53, 205.206.127.196, 0, 0, " cr ib nb 33l5151 "

rmladden
17-Nov-2003, 12:32 AM
The l in 33l5151 is going to be another problem. Test with CR-AS-CD-S520 which search should convert to S520.

JMK2
17-Nov-2003, 12:38 AM
Thanks Bob,

This is what we end up with:
2003/11/17 01:34, 205.206.127.196, 0, 0, "cr as cd s520"

But no results

rmladden
17-Nov-2003, 01:04 AM
I don't know what is happening. The perl line is not doing the same thing on your server as on my PC. I tested it with this:
while(1)
{
$line = <STDIN>;
$line =~ s/(\w*-)+/ /io;
print "$line\n";
}


and CR-AS-CD-S520 changes to just S520.

Anyway, since it becomes cr as cd s520 it should still match a product reference CR-AS-CD-S520 because the S520 would be a seperate word without the - in the list. At least that was my theory. We must be close, but it is an ugly hack. We may need some more expert help (Zoltan?).

rmladden
17-Nov-2003, 01:15 AM
Just for fun, try the line
$$psSearchString =~ s/(\w*-)/ /gio;

A minor change in syntax.

rmladden
17-Nov-2003, 01:23 AM
And after that try:
$$psSearchString =~ s/(\S*\-)/ /gio;
Make sure that is a capital S.

JMK2
17-Nov-2003, 02:21 AM
Here's the result of the 1st string suggested:

Version: 6
Date, Remote host, Customer ID, Buyer ID, Search words
2003/11/17 03:19, 205.206.127.196, 0, 0, "cr as crw 5224a"
2003/11/17 03:20, 205.206.127.196, 0, 0, "5224a"

But no reuslts returned either time. I'll try the other now.

rmladden
17-Nov-2003, 02:43 AM
I'm not feeling optimistic. :(

Even with the - out of the character set, Actinic is still not indexing the segments of your reference string. I think it is still indexing the whole reference as a single word.

That processing is not in code we can modify. Sorry. :(

rmladden
17-Nov-2003, 03:25 AM
My other thought is that if you have Actinic Business (I do not) is to create a new searchable property. Populate the property with the last segment of the reference. You may need another property with the entire reference. See page 51 of the advanced users guide.

rmladden
17-Nov-2003, 02:26 PM
I hate to give up on these type of things. Anyone have any ideas? How is the word index built? Perhaps it is possible to replace the Actinic generated index with one of your own.

JMK2
17-Nov-2003, 06:42 PM
Thanks Bob,

I was feeling too rotten with the flu bug yesterday so had to put it off till now.

I'm using business here so I can give that a try. The other thing I thought of trying just for fun. Right now I don't get any results from the Product reference field. I'll take aproduct and reverse the desc and prod ref fields and see what happens. It occured to me that perhaps to Prod Ref field is no longer being searched for some reason?

JMK2
17-Nov-2003, 11:02 PM
It would seem that somehow we've caused it not to search the Product reference section at all now. I tried the following test: I place a field in Product Reference "This is a test". Then I tried to search for "This is a test", and I got nothing.


2003/11/17 23:57, 205.206.127.196, 0, 0, "this is a test"

I see it changes the entry to all lower case BTW.

rmladden
17-Nov-2003, 11:29 PM
We did not do anything to affect that. It always coverted the search string to lower case. As usual, the advice is to delete the .fil files in your site folder and the server and refresh. Check that your word character set is ok.

Also the words "this", "is", "a" are in the stop list, so those words are never found.

JMK2
17-Nov-2003, 11:33 PM
I forgot about that stop list, and I agree it would not make sense that we did anything to have it stop searching the Prod ref per se.

I'll delete those files and try another test and see what happens.

Thanks.

JMK2
18-Nov-2003, 12:06 AM
Well kind of strange, I created a new record, 'pericardial tamponade' for product reference, and 'No Field' for Short Description. Now I get no result for either although i did a fresh import and a refresh. I'll place them in their own section and see what happens again.

I see, it's telling me to make it less than 20 characters, that's probably why.

OK, got that fixed and have been able to confirm that the search is not searching the product reference field at all. Is there a switch somewhere where searching on that field may have been turned off perhaps?

rmladden
18-Nov-2003, 12:52 AM
The closest thing is Index Extended Product Info. Check that.

According to the help, what we were trying to do should have worked. I don't understand why it is not working at all now.

JMK2
18-Nov-2003, 02:05 AM
That would index the Extended info page, not the Product Reference I would have thought, and I have no such pages, but I gave it a try and no luck.

rmladden
18-Nov-2003, 02:47 AM
I tested on my own site and Actinic will not use a - to break up words. I don't know why you are having so many other problems.

JMK2
18-Nov-2003, 02:58 AM
Thanks Bob,

But that would not appear to be our problem any longer. The problem would appear to be that it is not searching anything whatsoever in the Product reference field, '-' notwithstanding.

So now I'm trying to figure out why that may be, I'm sure if I could get it searching product reference again yur fix to the search.pm file would work.

rmladden
18-Nov-2003, 03:07 AM
Take out my fix. If Actinic will not index words seperated by a - then it will never work. It should, but it doesn't.

That does not explain the big search problem.

JMK2
18-Nov-2003, 03:12 AM
I already did take the fix out, and I've discovered something that is encouraging. It will not search all items in just one section called "computer equipment", it in fact is searching the other sections. There must be a switch somewhere that has turned that section off for being included in the search perhaps?

Also on your fix, just below it is another line that was originall in there:

$$psSearchString =~ s/\s+/ /go;

Should I comment it out if I use yours?

rmladden
18-Nov-2003, 03:21 AM
Keep that. It takes out multiple spaces. I think my fix is hopeless without being able to modify the indexing.

Is the section hidden on the web site?

JMK2
18-Nov-2003, 03:28 AM
Yes, it would appear that the fix is not doing anything. If I place the following string into a section that I know can be searched:

Fusion-asdf99

and try the following search terms:
Fusion-asdf99
asdf99

I get nothing.

If I try "fusion" then I get a result. it would appear that although it is "looking" for the distinct word "asdf99" it is not "finding" "asdf99" because it still sees the "-".

In that case it looks like I'd be better off to place the "-"back into the list of search strings.

Oh, and that section is not hidden. It is broken into subsections, 50 items to a subsection for a total of about 3500 items.

JMK2
19-Nov-2003, 06:04 PM
Well Bob,

For the time being I decided it would be easiest to dig a lateral hole: I got Excel to replace all the "-" with a blank in the csv source file.

Thanks for all the help.

NormanRouxel
19-Nov-2003, 06:39 PM
Now that this threads in the Guinness Book of Records for its prize winning length, I though I'd throw in my thoughts.

If you're able to process the csv file then why not do this:-

Take your product reference column, copy to a new column (say SREF) with the "-" replaced by spaces. Now make a new Description column that contains the Original Description + "!!<<noscript>>!!" + SREF + "!!<</noscript>>!!"

e.g. If the text was "Wowza Product" and the Reference was "AB-CD-XYZ1234" you'd generate a description field like this:-

Wowza Product!!<<noscript>>!!AB CD XYZ1234!!<</noscript>>!!

and Actinic will happy index all the words there but the customer won't see the bits inside the <noscript> tag.

When importing use the original product reference for your catalog but this extended description for the text and there you are.

This way you get the list of bits invisibly inserted into the product description where the original search scripts can operate on them.

Norman

JMK2
19-Nov-2003, 06:53 PM
heh, heh, thanks Norman, didn't I see you on Bargain Hunt once too (could you be the new host Jan has mentioned)?

Wow, now that's an interesting thought. It may exactly address one of my main problems which is the distributor gives us a very scant description to work with. For example, Asus motherboards, the only place they have the actual motherboard model number is embedded in their own proprietary part number (my Product Reference) and that is the number that uses all the "-" in it. As it would make sense if you're looking for an Asus motherboard the first thing you would do is search for the model number of the board you want, so ths may be my solution.

Right now I get the distributors data in a csv file. I dynamically link it to my own xls file wherein I add other products from other suppliers. Then I save that file as a csv that is used as the import source for the catalog. Bit of a pain in that I cannot massage the data in the xls file because it contains dynamic links and appears to 'see' only the link info and not the actual source data in each cell, but I can do it in the last csv file manually each time.

Thanks, I'll let you know how it goes.

rmladden
21-Nov-2003, 01:27 AM
If you are going to change the references, I got my fix working. The line was correct, but the location in the code was wrong. Actinic already removed the '-'.
In search.pm, after the line:
# Split words on the same boundaries as the C++ does
Put this line:
$$psSearchString =~ s/(\S+)\-/ /gio;

This will change CR-AS-CD-S520 to S520 to search on the significant part of the reference. Otherwise it will match on cr,as,and cd too in this example.

JMK2
21-Nov-2003, 02:04 AM
Thanks Bob, when I can get things sorted with the site in general I'll certainly take the time to impliment that. Thanks for taking the time.

JMK2
26-Nov-2003, 09:03 AM
Gave it a try but no luck so far. Do I need to take the old line out or add the "-" to the search string now?

Perhaps I missed doing something.

Thanks Bob.

rmladden
26-Nov-2003, 10:51 AM
The '-' should be out.

Post the search log.

rmladden
26-Nov-2003, 12:35 PM
Also be sure you put the new line in the new location I specified.