Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PasswordSearch with multiple search strings #86

Closed
GoogleCodeExporter opened this issue May 23, 2015 · 2 comments
Closed

PasswordSearch with multiple search strings #86

GoogleCodeExporter opened this issue May 23, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

@GoogleCodeExporter GoogleCodeExporter commented May 23, 2015

Please describe desired steps of proposed new feature/enhancement:

1. We want to have the possibility to search for new passwords with multiple 
search strings. Can we arrive this? The search should match for explenation, 
when the user writes into the search list the two strings "chief" and "root" 
then every passwords should be displayed which contain chief or root or chief 
and root.


What version of the product are you using? On what operating system?

v.1.2.1


Original issue reported on code.google.com by heindl...@googlemail.com on 27 Jun 2013 at 3:47

@GoogleCodeExporter
Copy link
Author

@GoogleCodeExporter GoogleCodeExporter commented May 23, 2015

Original comment by joshdrum...@gmail.com on 28 Jul 2013 at 11:18

  • Changed state: Accepted
  • Added labels: Milestone-Release1.4
joshdrummond added a commit that referenced this issue Jul 9, 2015
@mateuszskala
Copy link

@mateuszskala mateuszskala commented Sep 18, 2015

For me it's not working becouse for all searchTerms You add all finded passwords to passwordSet in PasswordServiceImpl.java
I have fixed this by code:

--- PasswordServiceImpl.java (d133399)
+++ Current File
@@ -253,10 +253,17 @@
         else
         {
             Set passwordSet = new HashSet();
+            Boolean firstSearchTerm=true;
             for (String searchTerm : searchTerms)
             {
+                if (firstSearchTerm) {
                 passwordSet.addAll(passwordDAO.findPasswordByFuzzySearch(searchTerm, loggedInUser, activeOnly, tags, tagMatch));
+                firstSearchTerm=false;
             }
+                else{
+                    passwordSet.retainAll(passwordDAO.findPasswordByFuzzySearch(searchTerm, loggedInUser, activeOnly, tags, tagMatch));
+                }
+            }
             passwords.addAll(passwordSet);
         }
         Collections.sort(passwords);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.