-
Notifications
You must be signed in to change notification settings - Fork 4
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
UG and DG Enhancements and Fix Find Command #132
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,46 +235,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] ...` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the first |
||
- 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` | ||
|
||
|
@@ -312,32 +316,32 @@ 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. | ||
guanquann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Shows a list of all orders for a contact, 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` | ||
|
||
* Shows a list of all orders for the supplier at the specified `INDEX`. The index refers to the index number shown in the displayed supplier list. The index **must be a positive integer, starting from 1** (1, 2, 3, …) | ||
* Shows a list of all orders for the contact at the specified `INDEX`. The index refers to the index number shown in the displayed contact list. The index **must be a positive integer, starting from 1** (1, 2, 3, …) | ||
|
||
### Deleting an order : `deleteorder` | ||
|
||
Deletes an order from a particular person. | ||
|
||
Format: `deleteorder INDEX o/ORDER_INDEX` | ||
|
||
* Deletes a particular order for the supplier at the specified `INDEX`. The index refers to the index number shown in the displayed supplier list. The index **must be a positive integer, starting from 1** (1, 2, 3, …) | ||
* Deletes a particular order for the contact at the specified `INDEX`. The index refers to the index number shown in the displayed contact list. The index **must be a positive integer, starting from 1** (1, 2, 3, …) | ||
* The ORDER_INDEX refers to the index number shown in the displayed order list. The order index **must be a positive integer, starting from 1** (1, 2, 3, …) | ||
|
||
**Important Note on Order Index**: | ||
The ORDER_INDEX is determined based on the chronological order of the orders' dates from earliest to the latest (if 2 orders have the same date, they will then be sorted in the order they were added), not the sequence in which the orders were added. This means the orders are sorted by their dates, with the earliest orders appearing first. Hence, it is suggested you first list the orders for a supplier to determine the correct order index to delete. | ||
The ORDER_INDEX is determined based on the chronological order of the orders' dates from earliest to the latest (if 2 orders have the same date, they will then be sorted in the order they were added), not the sequence in which the orders were added. This means the orders are sorted by their dates, with the earliest orders appearing first. Hence, it is suggested you first list the orders for a contact to determine the correct order index to delete. | ||
|
||
Examples: | ||
* Assuming the 1st supplier has 3 orders that were added in the following order: | ||
* Assuming the 1st contact has 3 orders that were added in the following order: | ||
* `addorder 1 d/2020-01-01 r/100 chicken wings` | ||
* `addorder 1 d/2020-01-02 r/200 chicken wings` | ||
* `addorder 1 d/2019-12-31 r/300 chicken wings` | ||
* `deleteorder 1 o/1` deletes the 1st order for the 1st supplier in the address book. Which in the above example will remove the order added by `addorder 1 d/2019-12-31 r/300 chicken wings` Since the orders are sorted by date when added to a supplier | ||
* `deleteorder 1 o/1` deletes the 1st order for the 1st contact in the address book. Which in the above example will remove the order added by `addorder 1 d/2019-12-31 r/300 chicken wings` Since the orders are sorted by date when added to a contact | ||
* `deleteorder 55 o/1` will return an error message if there is no 55th person in the address book and the index is invalid | ||
* `deleteorder 1 o/55` will return an error message if there is no 55th order for the 1st supplier in the address book and the order index is invalid | ||
* `deleteorder 1 o/55` will return an error message if there is no 55th order for the 1st contact in the address book and the order index is invalid | ||
|
||
### Deleting a person : `delete` | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"; | ||
|
||
Comment on lines
-21
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm not sure if this violate feature freeze? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is just an update to documentation - no change made to the actual command There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
private final SearchPredicate predicate; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should bold the
:
as well 😆