Menu

How to only search first word?

Help
VenDiddy
2005-07-22
2013-04-11
  • VenDiddy

    VenDiddy - 2005-07-22

    How would I only search the first word? Let us say I have 3 words in the list:
    John Doe
    Bob Johnson
    Kevin Smith
    If I typed "J" into the textbox then Bob Johnson would return as a match since it searches last names also. Is there a way where I can only search the first names or just search simply from left to right?

    One more question: how can I modify the keystrokes in the JavaScript file (ex: add more shortcuts of my own)? Thanks, I'm pretty new to JavaScript.

     
    • inhwajyoo

      inhwajyoo - 2005-08-10

      I also have the very same issue here. Tried to edit the source code to get only the content starting with the word not containing. I think it's [runMatchingLogic] function to deal with this issue but can't be pretty sure which part should be edited.

      Thank you for this great source and the support in advance.

       
    • inhwajyoo

      inhwajyoo - 2005-08-10

      in the runMatchingLogic function, I just commented out the part below :

      /*else if (mEntry.match(re1m) || mEntry.match(re2m)) {
                  if (!standalone && displayMatches) {
                      siw.matchCollection[j] = new smartInputMatch(entry, mEntry.replace(/\>/gi,'}').replace(/\</gi,'{').replace(re1,"$1<b>$2</b>").replace(re2,"$1<b>$2</b>"));
                  }
                  tempCollection[j] = entry;
                  j++;
              }*/

      and it works just like I wished it would be.
      Hope it could be helpful for others too. :)

       
    • Sean

      Sean - 2005-11-18

      inhwajyoo,
      I did what you suggested, it worked for the purpose of matching only the first word. but it break something else. for example, i typed 'a' then selected a word from the list, if i typed in 'a' again, the list wouldn't show up, unless i typed other characters.

      Can someone help with this plz :)

       

Log in to post a comment.

MongoDB Logo MongoDB