Solved Keyword search - best method to stack the searches (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:57
Joined
May 21, 2018
Messages
4,909
@coasterman,
Just curious if this is really what you want, because based on what you said, I would think it may be different. It sounds like you want to continue to narrow down within your search. If that is true you would only want to have viable tags to pick from.

First you list should only show viable tags which are the tags associated to a record. It is this smaller list. You should not be able to pick something that is not feasible.

qryHasTag qryHasTag

TagIDTag
22​
keyword 2
23​
brian
24​
ball
25​
yellow
26​
Square
27​
Triangle
28​
circle
29​
black
30​
green
31​
purple
32​
orange
35​
Brown

If you pick Circle and it returns 3 records, then your list to pick from should not only remove Circle, but it should only show those tags that are in the remaining three records. If not then you will have other infeasible choices. In other words if none of the three records have Brian I should not be presented Brian as a choice because no records in the db has Circle and Brian.

This is a harder query. Not sure if this is what you want. It would drive me nuts to be presented choices that are not feasible.
 

bastanu

Active member
Local time
Today, 11:57
Joined
Apr 13, 2010
Messages
755
Wouldn't the solution I gave to OP in post # 8 do that? First square then circle then.....The OP marked it solved in post #10 and yet we keep going...

Anyway, I'm out..

Cheers,
Vlad
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:57
Joined
May 21, 2018
Messages
4,909
No it just makes an and filter, which may be fine. A true narrowing filter only allows you to filter viable choices that remain. You do not reduce the tags to just those left in the reduced set.
 

bastanu

Active member
Local time
Today, 11:57
Joined
Apr 13, 2010
Messages
755
I think I do as the combo's row source is not showing the ones already used, is that what you mean?
 

coasterman

Registered User.
Local time
Today, 11:57
Joined
Oct 1, 2012
Messages
59
Hi, It is the case as Majp has described that the full wish list would include the ability to have the combo only display those keywords which appear in the main records after the initial selcection. I was so pleased with the initial part of the puzzle being solved that I didn't want to impose further and felt it only right that I studied what had been done so far and seeing if that might give my a clue as what I could do to solve the other part of the problem.

I did try to see whether I might be able to add the other two tables (in the example) to the rowsource for the combo and see whether that could be coaxed into just returning those keywords but wasnt able to get anywhere. There is something at the fringes which is telling me my logic there is flawed. Again simply think aloud I guess step 1 is a identify the PK ID's for the parent records AFTER the users previous selection. Step 2 capture via the Parent FK in the Keyword junction table all keyword Id's where the two are a match. Step 3 make that Keyword ID 'list' the recordsource for the combo and so on.

I could and quite possible am talking complete nonsense but that is where my thinking is at the moment - If I am by some miracle on the right path how to execute this and by what method is where I will be needing some help for sure.

Thanks all
 

bastanu

Active member
Local time
Today, 11:57
Joined
Apr 13, 2010
Messages
755
Please review this updated file, I have addressed a logic flaw in the first version (you would have gotten some false positives looking for the keyword ID in the list as ID =2 would have been included if the list included ID 12 or 21; now the Instr function is looking for the ",2," (including the delimiting commas). I think I also solved the combo source to only inlcude what "is left".

Cheers,
Vlad
 

Attachments

  • keyword searchVlad2.zip
    50 KB · Views: 16

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:57
Joined
May 21, 2018
Messages
4,909
Yes that is exactly what I was saying. Without that fix to the selections, it would be of little use.
You could imagine having a 101 tags related to records. You pick one tag it returns 5 records and between them there are 10 unique tags. It would be a PITA to refine your search because 90% of the time the second selection would return no records.
 

bastanu

Active member
Local time
Today, 11:57
Joined
Apr 13, 2010
Messages
755
Yes, I was a bit tired last night and didn't quite got what you meant, sorry about that!
Cheers,
 

coasterman

Registered User.
Local time
Today, 11:57
Joined
Oct 1, 2012
Messages
59
I haven't had chance to see how that was achieved but WoW!!! Thats brilliant and is my complete wish list for the search function and more than I had even hoped for. I cannot thank you enough. This will I am sure spur me on to get what remains of the project to completion.
 

Users who are viewing this thread

Top Bottom