<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">OK, that was easier than I thought.<br>
      <br>
      One just has to change files
      ~eprints/archives/repo/cfg/cfg.d/eprint_search_advanced.pl and
      ~eprints/archives/repo/cfg/cfg.d/eprint_search_simple.pl (advanced
      and simple search accordingly) to contain 'ml_title' and
      'ml_abstract' instead of 'title' and 'abstract' in their
      meta_fields definitions.<br>
      <br>
      As Adam suggested, it'd be wiser if these two configuration files
      are not changed themselves (for update robustness) and rather copy
      them to new ones with the exact same names suffixed by an
      underscore and your comment and to make your changes there. This
      way they'll be loaded right after their original counterparts when
      configuration is read.<br>
      <br>
      Thanks all again!<br>
      <br>
      On 02/07/2015 03:57 μμ, George Mamalakis wrote:<br>
    </div>
    <blockquote
cite="mid:EMEW3|0c49d86153b143267c432f151716f42er61Dvg14eprints-tech-bounces|ecs.soton.ac.uk|5595352C.2050508@eng.auth.gr"
      type="cite">
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
      <div class="moz-cite-prefix">Hi all,<br>
        <br>
        First of all I started a new thread, since the objective of the
        question has strayed from its original form (nothing to do with
        finding selected language from configuration) and the new
        question is quite self contained.<br>
        <br>
        Secondly, I did some research before asking for further help,
        and here are my findings (I am using the *title* field in these
        examples):<br>
        <br>
        1) Each multilang eprints field generates three additional
        fields in every eprint__ordervalue_xx table of your database
        (where xx may stand for en, el, etc.), namely: ml_title_text,
        ml_title_lang, ml_title_text (all of them are of type longtext)<br>
        2) The peculiar thing is that all language texts are stored in
        the ml_title_text field of *every* eprint__ordervalues_xx table.
        What I mean is that each eprint__ordervalue_xx language table
        (eg. en, el) contains the exact same information.<br>
        3) When performing an API search to see how searching the
        ml_title field is performed using the following code (which just
        searches for the "title" keyword within our multilang ml_title
        field):<br>
        <br>
        use EPrints;<br>
        my $ep = EPrints-&gt;new();<br>
        my $repo = $ep-&gt;repository( "testpamak1" );<br>
        my $ds = $repo-&gt;dataset("archive");<br>
        my $an_eprint = $repo-&gt;eprint( 23 );<br>
        <br>
        $list = $ds-&gt;search(search_fields =&gt; [{<br>
            meta_fields =&gt; [qw( ml_title )], value =&gt; "title",<br>
          }]);<br>
        <br>
        <br>
        the generated SQL was:<br>
        <br>
        SELECT `eprint`.`eprintid` FROM `eprint`, `eprint__rindex` AS
        `eprint__rindex` WHERE
        `eprint`.`eprintid`=`eprint__rindex`.`eprintid` AND
        (`eprint`.`eprint_status` = 'archive' AND
        `eprint__rindex`.`field`='ml_title_text' AND
        `eprint__rindex`.`word`='title') GROUP BY `eprint`.`eprintid`<br>
        <br>
        Meaning that the real search was performed in the eprint__rindex
        table. This table has a 'field' column and a 'word' column,
        where the 'field' column in our case is 'ml_title' and the
        'word' column equals to our search keyword, which is 'title'.<br>
        <br>
        That said, it seems that the search process (at least as far as
        the API is concerned) will work just fine, if we somehow manage
        to use the multilang fields in our searches (eg. ml_title,
        ml_abstract, ml_creator, etc.).<br>
        <br>
        Now, my questions are as follows: <br>
        <br>
        - Where should I start in order to create a custom search form?
        Is there any documentation or should I try to understand how it
        works by reading
        <meta http-equiv="content-type" content="text/html;
          charset=utf-8">
        eprint_search_advanced.pl? <br>
        - Is there another, maybe easier way to achieve searching within
        the multilang fields or their associated virtual fields?<br>
        <br>
        Thanks all in advance,<br>
        <br>
        George.<br>
        <br>
        On 02/07/2015 02:17 μμ, Adam Field wrote:<br>
      </div>
      <blockquote
cite="mid:EMEW3|5ad7e3d266d5d8a4d5c99ff4495775ear61CHl14eprints-tech-bounces|ecs.soton.ac.uk|1AE2ABA6-F618-4973-9399-E210D0B78478@ecs.soton.ac.uk"
        type="cite">I don't believe virtual fields will get searched
        because they aren't stored in the database.
        <div class=""><br class="">
        </div>
        <div class="">You should add the multilang field to the search
          form, but I'm actually not sure how it will behave.</div>
        <div class=""><br class="">
        </div>
        <div class="">
          <div class="">
            <div style="color: rgb(0, 0, 0); letter-spacing: normal;
              orphans: auto; text-align: start; text-indent: 0px;
              text-transform: none; white-space: normal; widows: auto;
              word-spacing: 0px; -webkit-text-stroke-width: 0px;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;" class="">
              <div class="">--</div>
              <div class="">Adam Field</div>
              <div class="">Business Relationship Manager and Community
                Lead<br class="">
                EPrints Services</div>
            </div>
          </div>
          <br class="">
          <div>
            <blockquote type="cite" class="">
              <div class="">On 2 Jul 2015, at 12:10, George Mamalakis
                &lt;<a moz-do-not-send="true"
                  href="mailto:mamalos@eng.auth.gr" class="">mamalos@eng.auth.gr</a>&gt;
                wrote:</div>
              <br class="Apple-interchange-newline">
              <div class="">
                <meta content="text/html; charset=utf-8"
                  http-equiv="Content-Type" class="">
                <div text="#000000" bgcolor="#FFFFFF" class="">
                  <div class="moz-cite-prefix">Excellent observation
                    skills!! :):)...and sorry for not having seen that.<br
                      class="">
                    <br class="">
                    One more question. With this setup (for title and
                    abstract with two fields each), will searches work
                    as expected? Meaning that, based on the selected
                    language, EPrints will search the (dynamically
                    generated) appropriate language title field for
                    example? Because I'm trying to test it, but I'm
                    facing some difficulties using the extended search
                    menu, and I'm not sure if this is the problem
                    (putting the title ). Simple search works just fine,
                    but I assume that simple search searches all fields?<br
                      class="">
                    <br class="">
                    Thanks again!<br class="">
                    <br class="">
                    George.</div>
                </div>
              </div>
            </blockquote>
          </div>
        </div>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
George Mamalakis

IT and Security Officer, 
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)

School of Electrical and Computer Engineering
Aristotle University of Thessaloniki

phone number : +30 (2310) 994379


</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
George Mamalakis

IT and Security Officer, 
Electrical and Computer Engineer (Aristotle Univ. of Thessaloniki),
PhD (Aristotle Univ. of Thessaloniki),
MSc (Imperial College of London)

School of Electrical and Computer Engineering
Aristotle University of Thessaloniki

phone number : +30 (2310) 994379


</pre>
  </body>
</html>