Gossamer Forum
Home : Products : DBMan : Installation :

Search - Field not equal to

Quote Reply
Search - Field not equal to
How can I do a search for all records that the field "Mobile" is not equal to "fixed".
Quote Reply
Re: Search - Field not equal to In reply to
I have never figured that out. I would love to be able to do a search for every record where the value *doesn't* equal something. Maybe somebody else has some ideas.


------------------
JPD





Quote Reply
Re: Search - Field not equal to In reply to
Alex is adding boolean style operators (is that the correct term?) like AND and OR to dbMan - The Next Generation isn't he? Wonder if NOT will be part of the package? Or a minus sign. Wonder when it's coming, he said in anticip...

adam
Quote Reply
Re: Search - Field not equal to In reply to
Does Alex know how to do this in the current version?
Quote Reply
Re: Search - Field not equal to In reply to
Well, "or" searches are easy. It's just a regular expression --this|that. "And" searches require a whole structure with nested "if"s for each possibility--

"this and that"

becomes
Code:
if ("this" is there) {
if ("that" is there {
this is a record we want
}
}

If you had "this and that and the other thing" you'd have to have three nested "if"s and so on. I'm going to be very interested in looking at that code when it's ready.

"Not" searches require an extra structure, too, because at least I can't figure out how to do a "not" in a regular expression. What would have to happen is that the search would have to go through and pick all the things that worked for the rest of the search and then go through the hits and delete the ones that matched the "not." Even if the only search term was a "not," I think it would have to gather the whole database and go through it again. At least I think that's how it would work.

At this point, my mind boggles at the thought.


------------------
JPD





Quote Reply
Re: Search - Field not equal to In reply to
Oh, I know you can do that in the search form, I just meant that it'll be great when the new version comes out if it has Boolean style operators, since people are so used to using them on the search engines. Most people who'll be searching one of our databases wouldn't have a notion how to use regular expressions to search it. For instance, I log search terms on one of my sites and people regularly use something AND something OR something, but that won't work...

And surely it wouldn't be that difficult to add a Boolean NOT or minus to dbMan, wouldn't he just have to make stuff not equal (ne) to the regular expression created by the search terms?

Anyway, I ramble. Better be off to do some of that "work" thing... Smile

adam
Quote Reply
Re: Search - Field not equal to In reply to
Yes, you're right.

I really haven't looked into how the search works much.

It looks like the "not" searches would require a structure much like the "greater than" and "less than" structures. I might be able to work on that this weekend.

You can allow "or" searches without using the regular expressions, though, right now. I posted the code just this week, I think. If you can't find it, let me know and I'll give it a try.


------------------
JPD