4 Replies Latest reply: Mar 20, 2010 1:17 PM by 843833 RSS

    How to create search index files for Java Pet Store

    843833
      Hi All,

      As you may know, the java pet store application uses for the search function a search index object, which itself uses the following files '_36.cfs', 'deletable', 'segments'.
      Now as I want to change the data of the database (delete some pets, and names, etc.), it does not have an effect on the search results. This is because the application uses the search index files and does not use the database for the search query.

      So can anybody help me and tell me how I can create this three files from my *.sql file, so I can search in my own data?
      Thank you very much for your help.

      Regards,
      Wolfgang
        • 1. Re: How to create search index files for Java Pet Store
          419219
          2 year old thread. I need answer on the same question
          • 2. Re: How to create search index files for Java Pet Store
            843833
            Solved:

            I had the same problem. It seems that the installer does not unzip three files where it should.

            With NetBeans (Using File Perspective) or just editing build.xml
            Netbeans: select build.xml/Run Target/Other Targets/unzipindexes: Tough it should work it fails in resolving $javaee.domaindir$ at least in my system, but it does suscessfully create a new directory named ${jee.domaindir} that includes lib/petstore/searchindex and three files: _36.cfs , deletable, segments.

            Copy those three files to your_glasshfish_path/domains/domain1/petstore/searchindex.

            Now you are done. I hope that you had a nice time while waiting two years for it to be answered. How is it that it is not answered anywhere else?

            Regards,
            Ramon Talavera
            www.sciencetechworks.com
            • 3. Re: How to create search index files for Java Pet Store
              419219
              gonso777 wrote:
              Solved:

              I had the same problem. It seems that the installer does not unzip three files where it should.

              With NetBeans (Using File Perspective) or just editing build.xml
              Netbeans: select build.xml/Run Target/Other Targets/unzipindexes: Tough it should work it fails in resolving $javaee.domaindir$ at least in my system, but it does suscessfully create a new directory named ${jee.domaindir} that includes lib/petstore/searchindex and three files: _36.cfs , deletable, segments.

              Copy those three files to your_glasshfish_path/domains/domain1/petstore/searchindex.

              Now you are done. I hope that you had a nice time while waiting two years for it to be answered. How is it that it is not answered anywhere else?

              Regards,
              Ramon Talavera
              www.sciencetechworks.com
              Thanks. I didn't wait 2 years for this, but I just replied on a 2 year old post. I only recently tried the petstore app. I thought I needed to study lucene first to figure things out, it turns out there was an 'internal target' on the build file for this. Thanks a bunch!
              • 4. Re: How to create search index files for Java Pet Store
                843833
                The documentation for the Pet-Store says one can setup, deploy and run the application with ANT:
                (assuming all is configured correctly)
                1. open a command window
                2. change to the directory <app server root>/blueprints/petstore
                3. type:
                ant setup
                ant run

                The command
                ant setup
                also runs the target unzipIndexes

                Regards.