List Info

Thread: Results - Title




Results - Title
country flaguser name
United States
2007-09-22 06:29:58
Dear all,
I need to crawl many .doc files. GSA takes as Title of the
results the
title of .doc properties.Let's assume that there is the file
"First
Test.doc" and the title in properties is "Title
Test".When this file
will be crawled in the results will appear:
[MS Word] Title Test
Snippet
URL:...../First%20Test.doc

I want to modify the XSLT and appear as result:
[MS Word] First Test.doc
Snippet
URL:..../First Test.doc


So I want as result title to be the filename and to replace
is %20
with space.

If anyone could help I would be thankful. I found some
relevant posts
but I can have the result that I desire.

Thanks in advance.

POSTS:
[1]
http://groups.google
.com/group/Google-Mini/browse_thread/thread/c5cc1ef2f42b2a5e
/38500f0116c4c04e?lnk=gst&q=search+title&rnum=2#3850
0f0116c4c04e
[2]
http://groups.google.com/gr
oup/Google-Mini/browse_thread/thread/49a49cdfae5ffc28/dc996b
b3aa12997c?lnk=gst&q=%2520&rnum=2#dc996bb3aa12997c


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliancegooglegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Results - Title
country flaguser name
United States
2007-09-25 02:19:48
Hi ACE,

Here is a good example of some people trying to do what you
want to
do:

http://www.stylusstudio.com/xsllist/200306/post50900.ht
ml

Based upon that, here is what I had to do to make this work
in the
default XSLT:

1. Add this following template. This template will look for
the last
instance of a forward slash and then take the string that
comes after
that (in most cases the filename):

  <xsl:template
name="substring-after-last">
    <xsl:param name="url" />
    <xsl:param name="substr" />

    <!-- Extract the string which comes after the first
occurence -->
    <xsl:variable name="temp"
select="substring-after($url,$substr)"/>

    <xsl:choose>
      <!-- If it still contains the search string then
recursively
process -->
      <xsl:when test="$substr and
contains($temp,$substr)">
        <xsl:call-template
name="substring-after-last">
          <xsl:with-param name="url" 
select="$temp" />
          <xsl:with-param name="substr"
select="$substr" />
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$temp" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

2. Then, you will need to find the place where the title
text is
formed. This should be around line 2500-ish and then change
that code
to call the template you created above:

 <xsl:choose>
      <xsl:when test="T">
        <xsl:call-template
name="substring-after-last">
	  <xsl:with-param name="url"
select="$display_url"/>
	  <xsl:with-param name="substr"
select="'/'"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise><xsl:value-of
select="$stripped_url"/></
xsl:otherwise>
    </xsl:choose>

Hope this helps. I have not tested this for SMB or other
non-http URLs
but it should be ok.

Good luck!

Brian


On Sep 22, 8:29 pm, ACE1 <pkalogi...gmail.com> wrote:
> Dear all,
> I need to crawl many .doc files. GSA takes as Title of
the results the
> title of .doc properties.Let's assume that there is the
file "First
> Test.doc" and the title in properties is
"Title Test".When this file
> will be crawled in the results will appear:
> [MS Word] Title Test
> Snippet
> URL:...../First%20Test.doc
>
> I want to modify the XSLT and appear as result:
> [MS Word] First Test.doc
> Snippet
> URL:..../First Test.doc
>
> So I want as result title to be the filename and to
replace is %20
> with space.
>
> If anyone could help I would be thankful. I found some
relevant posts
> but I can have the result that I desire.
>
> Thanks in advance.
>
> POSTS:
> [1]http://groups.google.com/group/Google-Mi
ni/browse_thread/thread/c5cc1...
> [2]http://groups.google.com/group/Google-Mi
ni/browse_thread/thread/49a49...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliancegooglegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Results - Title
country flaguser name
United States
2007-09-25 04:48:37
Brian thank you very much. You did great job!
One question: Is there any way to replace the %20 with space
from the
title, that your code creates?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliancegooglegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Results - Title
country flaguser name
United States
2007-09-25 23:55:39
It might be easier doing some research here.

Have look here:
http://www.google.com/search?hl=en&a
mp;q=xslt+replace+string&btnG=Search

The first result appears to give you exactly what you want
(see second
example):
http:
//www.dpawson.co.uk/xsl/sect2/replace.html

Try that out and let us know how it goes. 

Brian

On Sep 25, 6:48 pm, ACE1 <pkalogi...gmail.com> wrote:
> Brian thank you very much. You did great job!
> One question: Is there any way to replace the %20 with
space from the
> title, that your code creates?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliancegooglegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Results - Title
country flaguser name
United States
2007-09-26 01:16:58
There is a string replacement utility function in the
default
stylesheet already. Look for occurrences of replace_string
for
examples of how to use it.

Thor.

On Sep 26, 2:55 pm, brian <brianj...gmail.com> wrote:
> It might be easier doing some research here.
>
> Have look here:http://www.google.com/search?hl=en&a
mp;q=xslt+replace+string&btnG=Search
>
> The first result appears to give you exactly what you
want (see second
> example):http:
//www.dpawson.co.uk/xsl/sect2/replace.html
>
> Try that out and let us know how it goes. 
>
> Brian
>
> On Sep 25, 6:48 pm, ACE1 <pkalogi...gmail.com> wrote:
>
> > Brian thank you very much. You did great job!
> > One question: Is there any way to replace the %20
with space from the
> > title, that your code creates?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Google Search Appliance" group.
To post to this group, send email to
Google-Search-Appliancegooglegroups.com
To unsubscribe from this group, send email to
Google-Search-Appliance-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/Google-Search-Applian
ce?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )