Skip to content

Commit

Permalink
Fix PE-D Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maze508 committed Apr 9, 2024
1 parent cd863c1 commit 0f11ba5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
8 changes: 8 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,3 +561,11 @@ testers are expected to do more _exploratory_ testing.
1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_

1. _{ more test cases …​ }_

---

## **Appendix: Planned Enhancements**

Team size: 4

4. The current implementation of the find command allows users to search for contacts based on their names, tags, or company names. However, it does not support searching by address, email, or phone number. We acknowledge that the ability to search by these fields can significantly enhance user experience by providing more flexibility and efficiency in locating contact information. The initial decision to exclude address, email, and phone number from the search criteria was based on a focus on the most commonly used identifiers for quick search and to maintain simplicity in the search interface. We also considered the privacy implications and the less frequent necessity of searching by personal information such as phone numbers or addresses. However, in order to enhance the utility of our contact management system, we are planning to introduce expanded search capabilities. This will include the ability to search for contacts by their phone numbers, email addresses, and physical addresses. This enhancement aims to provide a comprehensive search functionality that meets the needs of all users, making the tool more versatile and efficient for locating specific entries.
24 changes: 14 additions & 10 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,46 +237,50 @@ Examples:
- Search feature supports substring search by name and/or tags and/or company **ONLY**.
- Finds all contacts whose names, tags or company matches the substring keyword provided.


General Format: `find FIELD/ KEYWORD FIELD/ KEYWORD ...`
General Format: `find [FIELD/ KEYWORD] [FIELD/ KEYWORD] ...`
- Where `FIELD` is either `n/` for name or `t/` for tag or `c/` for company.
- `KEYWORD` is the keyword to search for, here are some guidelines:
- Each `FIELD` is optional BUT at least one `FIELD` and `KEYWORD` pair must be provided.
- `KEYWORD` is the keyword to search for, here are some rules:
- Name and Company should contain alphanumeric characters, spaces, hyphens and/or apostrophes only.
- Tags should contain alphanumeric characters only.
- The search is case-insensitive.
- Teh search will find contacts containing the provided keyword as a substring within the specified field(s)
- Multiple Search Fields are treated as a **Logical AND (&&)**. Therefore, a contact must match all specified keywords across any mentioned fields to appear in the search results.


#### Search Guidelines

* 'KEYWORD' cannot be empty.
* e.g. `find n/` will **NOT** work as 'KEYWORD' cannot be empty.


* 'KEYWORD' and next 'FIELD' should be separated by a space.
* e.g. `find n/John t/friends` will find all instances of John that have the tag friends
* but `find n/Johnt/tfriends` will instead return an error since it assumes you are searching for 'Johnt/tfriends'
* and there should not be non-alphabetic characters in the 'KEYWORD' field.
* e.g. `find n/John t/friends` will find all instances of John that have the tag friends, but `find n/Johnt/tfriends` will instead return an error since it assumes you are searching for 'Johnt/tfriends' and there should not be non-alphabetic characters in the 'KEYWORD' field.


* Multiple Search 'FIELD's will be treated as a **Logical AND (&&)**.
* e.g. `find n/John n/Doe` will return all instances of John and Doe.
* e.g. `find n/John t/friends c/ Meat` will return all instances of John that are tagged as friends and have Meat in their company name. This means if there exists a contact with the name John that is tagged as friends but has a company Mat, it will not be returned.
* e.g. `find n/Ale n/le` can return contacts such as ["Alex Lew", "Alexis Lebrun", "Alec"]


* 'KEYWORD' should **NOT** be empty and there should be at least one 'FIELD' and 'KEYWORD' pair.
* e.g. `find n/ t/` and `find ` will **NOT** work.


* There should not be prefixes before the first 'FIELD' and 'KEYWORD' pair.
* e.g. `find testing123 n/John` will **NOT** work.


* The search is case-insensitive.
* e.g. `find n/hans` will match `Hans Niemann` and `Hans Zimmer`


* The order of the keywords does not matter.
* e.g. Results of `find n/Hans n/Bo` will match the results of`find n/Bo n/Hans`


* You can have multiple of the same 'FIELD's.
* e.g. `find n/J n/Do` will match names with `J` AND `Do`, like `John Doe` or `Dohnut Jibs`


Examples:
* `find n/Joh` returns `john`, `John Doe` and `Johnann Sebastian Bach`

Expand Down Expand Up @@ -314,7 +318,7 @@ Examples:

### Listing orders : `listorder`

Shows a list of all orders for a supplier, sorted **first by date from the earliest to the latest and then by the order they were added if the dates are the same.
Shows a list of all orders for a supplier, sorted **FIRST** by date from the earliest to the latest and then by the order they were added if the dates are the same.

Format: `listorder INDEX`

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/logic/commands/FindCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ public class FindCommand extends Command {
public static final String MESSAGE_USAGE = COMMAND_WORD
+ ": Finds all persons whose names, tags or company names contain all of "
+ "the specified keywords (case-insensitive) and displays them as a list with index numbers.\n"
+ "Parameters: n/KEYWORD [MORE_KEYWORDS]... t/KEYWORD [MORE_KEYWORDS]... c/KEYWORD [MORE_KEYWORDS]...\n"
+ "Example: " + COMMAND_WORD + " n/alice t/friends c/Meat \n"
+ "Note: Multiple keywords (name, tag or company) are treated with a logical AND.";
+ "Parameters: [n/NAME_KEYWORDS] [t/TAG_KEYWORDS] [c/COMPANY_KEYWORDS]\n"
+ "Each field is optional, "
+ "but at least one must be provided. All Keywords are combined using logical AND (&&).\n"
+ "Example: " + COMMAND_WORD + " n/alice t/friends c/Meat - "
+ "Finds all persons named 'alice' AND tagged as 'friends' AND who's company name is "
+ "associated with 'Meat'.\n";


private final SearchPredicate predicate;

Expand Down

0 comments on commit 0f11ba5

Please sign in to comment.