11 Replies Latest reply on Sep 25, 2013 1:13 PM by philmodjunk

    Search issue.

    Matty_1

      Title

      Search issue.

      Post

           Not sure why but when I search for something in a portal in one particular layout I keep getting a search result of none.  This used to work perfectly fine and I don't know what I could have done to break this.  One important fact to note is that I do send the user to a special search layout but I verified to make sure the portal used the same occurrence and everything else was identical so beyond that I don't know why it won't simply work.

           Also note that anything searched outside the portal works fine.

           Thanks!

        • 1. Re: Search issue.
          philmodjunk

               And what criteria are you using in this find?

               Is it a scripted find or done manually?

          • 2. Re: Search issue.
            Matty_1

                 Manually, the user clicks on the magnifying glass and I have a script that takes them to the special find layout on enter find mode.  The user types in the search criteria in the portal field and then clicks perform find in the navigation bar. on exit find mode it returns the user to the original layout.

            • 3. Re: Search issue.
              philmodjunk

                   At what point do you get the search result of none? If you modify the script not to return to the original layout, do you see the correct found set after the find on the search layout?

                   You may find scripted finds modeled after the examples in this thread a better option: Scripted Find Examples

              • 4. Re: Search issue.
                Matty_1

                     No I modified it to stay on the original layout and still returns zero.  I will also review your link and see if I can make use of anything there.

                • 5. Re: Search issue.
                  philmodjunk

                       Well I was speculating that the change in layouts was an issue as that can mess things up in at least two different ways....

                       Can you give an example of the search criteria being entered that is failing to find records? If you enter really basic criteria like an asterisk in a field that is never empty, do you still get no records found? Is it only for criteria specified for a related record in the portal where you are getting this result?

                  • 6. Re: Search issue.
                    Matty_1
                         

                    If you enter really basic criteria like an asterisk in a field that is never empty, do you still get no records found?

                         Yes, I've tried an asterisks in all the fields in the portal and they all return nothing even if there are boat loads of records it could return.

                         

                    Is it only for criteria specified for a related record in the portal where you are getting this result?

                         Yes, anything outside of the portal in question (the only portal in this layout) performs as it should.

                         

                    Can you give an example of the search criteria being entered that is failing to find records?

                         "110" fails in a number field and "*" fails in all the fields.

                    • 7. Re: Search issue.
                      philmodjunk

                           "return nothing" as in "no records found" in the layout or no records showing in the portal? Might the portal be filtered and the filter is hiding the portal records that match the search criteria?

                           If that's not the issue, I have to wonder if the file or at least an index or two might be damaged. Recover a copy of the file and test the recovered copy to see if it shows the same issue. (Recovered files have rebuilt indexes and some other features are reset to "factory spec" so they may behave differently from the original even if the recover process does not report finding any damage.)

                           If the recovered file works OK, you might try using advanced recover options to rebuild the indexes in your file as a better option than replacing the damaged file with a back up copy.

                           Things to keep in mind about Recover:

                           While Recover almost always detects and fully corrects any problems with your file...

                             
                      1.           The recovered copy may behave differently even if recover reports "no problems found".
                      2.      
                      3.           Recover does not detect all problems
                      4.      
                      5.           Recover doesn't always fix all problems correctly
                      6.      
                      7.           Best Practice is to never put a recovered copy back into regular use or development. Instead, replace the damaged file with an undamaged back up copy if this is at all possible. You may have to save a clone of the back up copy and import all data from your recovered copy to get a working copy with the most up to date information possible.

                            

                           And here's a knowledgebase article that you may find useful: What to do when your file is corrupt (KB5421).

                           If you have FileMaker 11 or newer, you can use Advanced Recovery options to rebuild your file's indexes:

                             
                      1.           With the file closed, select Recover from the File Menu.
                      2.      
                      3.           Select "Use advanced Options"
                      4.      
                      5.           Select only: "Copy File Blocks as-is" and "Rebuild Field Indexes Now".
                      6.      
                      7.           The recovered copy of the file will be identical to the original copy except that it has completely rebuilt indexes.
                      • 8. Re: Search issue.
                        Matty_1

                             Hi Phil,  I tried the recovery and it still did not find any records ... so obviously it's something with my relationships and what fields I have in my layout but I can't seem to figure it out!

                             I even tried copy pasting the portal from the user layout to the find layout and it did not find any results.  Both layouts use the same exact occurrence for it's relationships and if I browse the records in the find layout everything seems normal and displays properly in the portal.  The issue also isn't in the changing of layouts because when I use the script debugger I get the error message that no records have been found before the change over to the user layout.

                             Last, as far as I can tell ... other layouts that are setup in the same fashion work as expected and return the appropriate found records in the portal.

                             Clueless.

                        • 9. Re: Search issue.
                          philmodjunk

                               Could this be a field containing text in your portal that is defined as a field of type number in Manage | Database | Fields?

                          • 10. Re: Search issue.
                            Matty_1

                                 No it's a field containing a number but is defined as a text field.  There are four fields in this portal, three are defined as number fields one as text.  I've tested things I know for sure are in the one text field and only " * " in the numbered fields and of course " * " in the text field as well.

                            • 11. Re: Search issue.
                              philmodjunk

                                   Care to share the file?

                                   You can upload a copy (just remove any sensitive data from it first) to a file sharing site such as Drop Box and post the download link here.