SearchResults

Changing Order Of Results

SearchResults.ChangingOrderOfResults History

Hide minor edits - Show changes to output

December 22, 2009, at 01:02 AM by 76.22.123.157 -
Changed lines 3-4 from:
Tables are searches in the order of the search layouts Table01, Table02, etc. So if you want to change the order, change the name of your layouts and change the corresponding assignment of context in the various sections of the script "Integration Settings".
to:
Tables are searched in the order of the search layouts Table01, Table02, etc. So if you want to change the order, change the name of your layouts and change the corresponding assignment of context in the various sections of the script "Integration Settings".
October 05, 2009, at 10:12 PM by 76.22.123.157 -
Added lines 13-14:
After that, enable the "Go to Record..." step following these Ifs. Or, if you don't have FileMaker Advanced, add a "Go to Record/Request/Page [First]" step after the disabled line.
June 27, 2009, at 06:14 PM by 67.160.86.122 -
Changed lines 17-18 from:
- You might consider making sorts conditional based on the size of the found set, so that if you accidentally enter a search that finds 10k records, you won't bother sorting them.
to:
- You might consider making sorts conditional based on the size of the found set, so that if you accidentally enter a search that finds 10k records, you won't bother sorting them. Since FileMaker doesn't sort large record sets well, consider an If (FoundCount < 100 ) step before running a sort.
Changed lines 23-38 from:
- The sort that we REALLY like to do is by match quality, but this can be very slow and is only available as part of custom modifications to SearchResults.

, or by frequency of access count, or last modification, or who knows what the customer might prefer. I reckon that sort by creation is possibly useful for accounts or invoices, but not at all for names or numbers
.

So to solve this, you're suggesting a user preference where they can specify a sort for each table? The user would just have to set this, as you can't sort by indirection yet. Kind of like the way the Result layout is set.

Maybe it would be good enough to just put a comment line in for 'Insert Sort Routing Here' ?

Here are some tips I have for sort, though they seem obvious:
1. The fastest sort is on a single indexed field in the current table.
2. Since FileMaker doesn't sort large record sets well, consider an If (FoundCount < 100 ) step before running a sort
3. Sorting on fields in related tables is very slow
4. Sorting on multiple fields is slow. Each field you add roughly doubles sort time.
5. The field you sort on should be displayed, so the user can quickly guess as to the sort order.
6. John Sindelar has nice abs
7. Sorting by value list is
especially useful, for example on Invoice Status.
to:
- The sort that we REALLY like to do is by match quality, but this can be very slow and is only available as part of custom modifications to SearchResults. (We've also done mods to list results by frequency of access count, or last modification, or who knows what the customer might prefer.)

- The fastest sort is on a single indexed field in the current table
.

- Sorting on fields in related tables is very slow.

- Sorting on multiple fields is slow. Each field you add roughly doubles sort time.

- The field
you sort on should be displayed, so the user can quickly guess as to the sort order.

- Sorting by value list can be
especially useful, for example on Invoice Status.
June 27, 2009, at 06:10 PM by 67.160.86.122 -
Changed lines 15-21 from:
<edit... the following is from SeedCode Complete and needs to be revised>

We’re doing some interesting things to keep the search results relevant but still keep the processing speed down. You may want to change some of these behaviors depending on your needs, so here is an overview of how the search results’ sort order
is determined.

For everything except the contacts table, we’re presenting results with the most recently created items first. To to this we don’t sort the search results, but we walk through them backwards
, from the last result forward) as we’re compiling the results to be displayed. You can find this behavior in the script “Search - Display Results ( Subject )”.

When it comes
to contacts, we wanted to show them in alphabetical order, even though that puts a load on the search as we have to sort the found set of contacts. You can find or modify this sort in the script “    Search Contacts”. Note that this sort has the results sorted alphabetically but descending. This is because we’re always walking through the results backward, so we want the names to line up that way. Feel free to change this sort or eliminate that sort step all together for more speed.
to:
'''Sorting Tips'''

- You might consider making sorts conditional based on the size of the found set, so that if you accidentally enter a search that finds 10k records, you won't bother sorting them.

- And even with a small found set of 100 or so, if the sort is multi-tiered or complex, and the user
is on a WAN, it will be the slowest single script step in the whole shebang, so ve wary.

- Also, the hope is that a search would yield very few results
, making sort unnecessary. Ideally, if there are too many results, the user would change the search to get a better result, exactly as they would in Google - people don't go to Page 2 often.

- The sort that we REALLY like to do is by match quality, but this can be very slow and is only available as part
of custom modifications to SearchResults.

,
or by frequency of access count, or last modification, or who knows what the customer might prefer. I reckon that sort by creation is possibly useful for accounts or invoices, but not at all for names or numbers.

So
to solve this, you're suggesting a user preference where they can specify a sort for each table? The user would just have to set this, as you can't sort by indirection yet. Kind of like the way the Result layout is set.

Maybe it would be good enough to just put a comment line in for 'Insert Sort Routing Here' ?

Here are some tips I have for sort, though they seem obvious:
1. The fastest sort is on a single indexed field in the current table.
2. Since FileMaker doesn't sort large record sets well, consider an If (FoundCount < 100 ) step before running a sort
3. Sorting on fields in related tables is very slow
4. Sorting on multiple fields is slow. Each field you add roughly doubles sort time.
5. The field you sort on should be displayed, so the user can quickly guess as to the sort order.
6. John Sindelar has nice abs
7. Sorting by value list is especially useful, for example on Invoice Status
.
June 27, 2009, at 06:07 PM by 67.160.86.122 -
Added lines 1-4:
!! Changing the order in which tables are searched

Tables are searches in the order of the search layouts Table01, Table02, etc. So if you want to change the order, change the name of your layouts and change the corresponding assignment of context in the various sections of the script "Integration Settings".

June 27, 2009, at 03:56 PM by 67.160.86.122 -
Added lines 3-10:
By default, we don't sort the results so you'll see them in creation order.

If you want to show results in a different order, the scripts are ready to do that, but know that if you're sorting a large set of results you could end up slowing things down, so be judicious about how you apply this.

You can add a sort to the results for one or more tables by editing the script "Create Result Lines". Toward the top of that script you'll find a comment "Sort results here if necessary" and below that an If() statement that offers one sort step for each context you're searching.

In this script $param = "01" means the first context you're searching, and the field(s) you elect to sort by in the subsequent step should be from the same table occurrence as the one the Table01 layout is based on.

June 27, 2009, at 03:37 PM by 67.160.86.122 -
March 18, 2009, at 08:38 PM by 67.160.86.122 -
Added lines 1-9:
!! How can I change the order results appear in?

<edit... the following is from SeedCode Complete and needs to be revised>

We’re doing some interesting things to keep the search results relevant but still keep the processing speed down. You may want to change some of these behaviors depending on your needs, so here is an overview of how the search results’ sort order is determined.

For everything except the contacts table, we’re presenting results with the most recently created items first. To to this we don’t sort the search results, but we walk through them backwards, from the last result forward) as we’re compiling the results to be displayed. You can find this behavior in the script “Search - Display Results ( Subject )”.

When it comes to contacts, we wanted to show them in alphabetical order, even though that puts a load on the search as we have to sort the found set of contacts. You can find or modify this sort in the script “    Search Contacts”. Note that this sort has the results sorted alphabetically but descending. This is because we’re always walking through the results backward, so we want the names to line up that way. Feel free to change this sort or eliminate that sort step all together for more speed.
(855) SEEDCODE
[email protected]
Follow us: