PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Multiple Values in Meta Search Fields?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple Values in Meta Search Fields?

    I need to assign multiple values to a search item but I haven't figured out if or how Zoom Search allows this:

    I tried this and a search yielded nothing:
    <meta name="META" content="Content1,Content2,Content3">

    So then I tried this and only Content1 was found; the other two were not found:

    <meta name="META" content="Content1">
    <meta name="META" content="Content2">
    <meta name="META" content="Content3">

    Thoughts?

  • #2
    What field type is this field?
    You need to use the multi-select field type if you want multiple values.

    Multi-select allows for multiple selections, while Drop-down text only allows for one value to be selected and specified per page. Multi-select also allows you to specify multiple meta values on the same page. For example, a book item may belong to multiple genres, and have the following meta values:

    <meta name="GENRE" content="Sci-fi">
    <meta name="GENRE" content="Horror">

    As with the drop-down text option, you must have these values specified in the list for them to be recognized and supported.

    Comment


    • #3
      No, it's not multi-select that I want. I don't want people to search for multiple items from a list. I want them to search for one thing -- a book, to use your example. But that book, as in your example, may belong to more than one genre, as you suggested.

      <meta name="GENRE" content="Sci-fi">
      <meta name="GENRE" content="Horror">

      Let's call the book "Scary Planet." I want people to be able to search for "Sci-Fi" -- from a drop-down list -- and come up with Scary Planet (among others). And then search for horror, and also come up with a list that includes Scary Planet. Two separate, single-item searches.

      Let's forget the book example. What I'm indexing are video games. Video games are often available on multiple platforms. I want to be able to assign those multiple platforms to a single game and have the game show up in a search if a person selects one of those platforms.

      When I used this, it didn't work:

      <meta name="PLATFORM" content="Xbox 360">
      <meta name="PLATFORM" content="PS3">
      <meta name="PLATFORM" content="DS">

      Comment


      • #4
        The multi-select field type is the only way you can get multiple values belonging to a single field.

        If you think about it, I don't see any reason why you shouldn't have multi-select. An user may well want to search for a game that is available on both PS3 and the DS. If a game can belong to both groups, a user should be able to search for a game belonging to both groups. Same with the books example, they may want something that is Sci-Fi AND Horror. Note that the user doesn't have to specify multiple values, only if they want to. You can see it in the demo here for the "Availability" field displaying a list of months.

        But if you feel strongly against having a multi-select list, you could define your own search form in HTML and specify a dropdown HTML for the same field (right click and "View Source" in the browser to confirm the values that you need per field).

        You will still have to define it as a Multi-Select field within Zoom however.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          Multi-Select may have some value. I'll need to experiment to see if we could use it.

          Here's another angle on an earlier query:

          Street Fighter IV is available on three platforms: Xbox 360, PS3 and PC.

          Is there any way to code the Street Fighter IV page so that should someone perform a basic text search for "Street Fighter IV," they would find three results: one each for "Xbox 360," "PS3" and "PC"?

          Comment


          • #6
            Each unique URL will only appear once in the search results. I think it would be rather annoying for the end user if they did in fact get 3 links to the exact same page (they would click on one link, decide, no I want to see the other link, go back, click on the other link, and then wonder why they're back where they were).

            If you have 3 different URLs for each platform, then yes. For example:
            http://mysite.com/streetfighteriv.php?platform=xbox360
            http://mysite.com/streetfighteriv.php?platform=ps3
            http://mysite.com/streetfighteriv.php?platform=pc

            Each of the pages may have different content, or the same, they would be considered 3 unique URLs and they can appear as different search results (provided you have "Duplicate Page Detection" turned off in Zoom)
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              I don't agree that it would necessarily be annoying to have three results for the same page. It could be viewed as useful information that helps the user make a choice.

              That aside, and using my Street Fighter IV example above, not being able to assign multiple platforms to a game severely diminishes the usefulness and effectiveness of a Zoom search for, for example, all games on PS3.

              Such a search wouldn't find Street Fighter IV on PS3 (or PC) if I coded the game this way: <meta name="PLATFORM" content="Xbox 360, PS3, PC">. It would only find Xbox 360.

              Having three separate URLs is not an option.

              So we have to code this ourselves? Is that the solution?

              Comment


              • #8
                Originally posted by pab1953 View Post
                I don't agree that it would necessarily be annoying to have three results for the same page. It could be viewed as useful information that helps the user make a choice.
                If it was 3 different results (each labelled differently, with a different title - "SF4 For PC", "SF4 for PS3", etc.) then yes. But 3 identical results? (remember that you're saying there is only 1 URL for all 3 results - so they have the same page title, same content, and same meta description).

                Originally posted by pab1953 View Post
                That aside, and using my Street Fighter IV example above, not being able to assign multiple platforms to a game severely diminishes the usefulness and effectiveness of a Zoom search for, for example, all games on PS3.

                Such a search wouldn't find Street Fighter IV on PS3 (or PC) if I coded the game this way: <meta name="PLATFORM" content="Xbox 360, PS3, PC">. It would only find Xbox 360.
                You can have multiple platforms assigned to a single game/page. This is what we've been describing throughout this thread. To re-cap:

                You specify "Multi-select" as the Custom Meta field type.

                You then have tags like this on a page:
                Code:
                <meta name="PLATFORM" content="Xbox 360">
                <meta name="PLATFORM" content="PS3">
                <meta name="PLATFORM" content="DS">
                Reindex, and now when you search for this game, it would show up in the search results as something like this:

                Street Fighter 4
                Platform: Xbox 360, PS3, DS
                Classic beat-em-up featuring a colourful cast of characters
                ... context description here ... this game teaches the importance of a well timed dragon punch in dire situations ...
                Score: 150 - URL: mysite.com/sf4
                Note that the multiple meta custom fields show up in the search result. And the user can search for "All" platforms, or any one (or more) of the available platforms specifically.

                But if you want it to appear as 3 separate search results, when you actually only have 1 page (i.e. 1 URL), then no, that's a very unusual requirement and it is not supported. I find it hard to imagine why you would desire that over the above behaviour however.
                Last edited by Ray; Jun-30-2010, 04:18 AM.
                --Ray
                Wrensoft Web Software
                Sydney, Australia
                Zoom Search Engine

                Comment


                • #9
                  I guess I misunderstood the use of multi-select. I thought it meant it only functioned if the user selected more than one variable for their search. I now see that it does search for multiple items as I wanted.

                  But using multi-select presents another -- visual -- problem: the list remains open at all times. This takes up too much space. Is there any way to have multi-select be a drop-down list?

                  Comment


                  • #10
                    You might want to re-read post #4.

                    But to elaborate/repeat:

                    You can create your own search form in HTML and not use the one that is generated. For example, this demo search page is pure HTML and is independent of the search script.

                    The best way to do this is to "View Source" on the generated form, and take a copy of the HTML. Then you'll have all your custom meta fields and their variable names given to you.

                    More information on defining your own search form can be found here:
                    Q. How do I put search forms on pages besides the search page? (Or define my own search form?)
                    --Ray
                    Wrensoft Web Software
                    Sydney, Australia
                    Zoom Search Engine

                    Comment


                    • #11
                      My solution to the problem

                      I came across this issue this morning and found this thread. I think I have a solution that seems to work.

                      Scenario:
                      A page can belong to any number of "zones". We implement this by adding a meta tag for each zone, eg
                      Code:
                      <meta name="ZONE" content="South-A" />
                      <meta name="ZONE" content="South-D" />
                      Users must only search in one zone at a time so we do not want a list box - we want a drop-down list.
                      It appears that Zoom does not support this scenario.

                      Solution:
                      I have added the following code to search_template.html:
                      Code:
                      <SCRIPT LANGUAGE="JavaScript">
                      <!--
                        function DisableMultiSelect(aName) {
                          for (i=0; i < document.forms[0].elements.length; i++){
                            if (document.forms[0].elements[i].name == aName){
                              document.forms[0].elements[i].outerHTML = document.forms[0].elements[i].outerHTML.replace("multiple ", "");
                            }
                          }
                        }
                      //-->
                      </SCRIPT>
                      Finally, I have changed the opening <body> tag as follows:
                      Code:
                      <body onload="DisableMultiSelect('ZONE[]');if (document.getElementById(... etc">
                      This technique causes the SELECT element to be changed from multi-select to single as the body loads.
                      The user doesn't see the change occur and the SELECT element retains its value between searches because Zoom is still controlling it.

                      Notes:
                      I have only tested this for CGI so far.
                      JavaScript developers may wonder why I looped through the form elements rather than referencing the SELECT element by name. This is simply because Zoom names the element "ZONE[]" and the square brackets cause a JavaScript error since they are supposed to indicate an array.

                      I've only just written this so there may be some nasties I haven't yet spotted.
                      Last edited by flongrim; Aug-17-2010, 05:10 PM.

                      Comment

                      Working...
                      X