Some changes to more search results...

2 views
Skip to first unread message

Phil Haack

unread,
Dec 25, 2009, 1:51:53 AM12/25/09
to sub...@googlegroups.com

I just checked in some changes to the more search results work that Simo did. I made it so that it automatically loads for every skin. You lose control over where it gets placed, but it always gets placed at the top of the main body. By default it’s highlighted bright yellow.

 

Please try it out and let me know what you think.

 

Also, if you run it on a local host, I made it so you can easily fake the referrer by using the URL. For example, append the following to the end of a blog post URL.

 

?referrer=http://google.com?q=test

 

That’ll trigger the feature.

 

Phil

Simone Chiaretta

unread,
Dec 25, 2009, 5:24:18 AM12/25/09
to sub...@googlegroups.com
Great, looking at the latest commit it seems like the box will be
displayed in every page, not just the single post page: is that
correct?

Good thing you moved it to the system skin: not many people will need
to change the way it looks :)

thx
Simone

> --
>
> You received this message because you are subscribed to the Google Groups "Subtext" group.
> To post to this group, send email to sub...@googlegroups.com.
> To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/subtext?hl=en.
>

--
Simone Chiaretta
Microsoft MVP ASP.NET - ASPInsider
Blog: http://codeclimber.net.nz
RSS: http://feeds2.feedburner.com/codeclimber
twitter: @simonech

Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"

Phil Haack

unread,
Dec 25, 2009, 1:14:13 PM12/25/09
to sub...@googlegroups.com
It will show up on pretty much every page. Any page that uses DTP.aspx. Should I change that? Does it make sense to only use it with a single post page?

Phil

Simone Chiaretta

unread,
Dec 25, 2009, 1:43:53 PM12/25/09
to sub...@googlegroups.com
Yeah, makes more sense.
Not sure about the homepage: maybe it will be cool to have a div that
can be closed
simo

Phil Haack

unread,
Dec 25, 2009, 2:30:29 PM12/25/09
to sub...@googlegroups.com
Ok, I'll put an ugly hack to not have it show up on the homepage. I'll also add a close link.

Simone Chiaretta

unread,
Dec 27, 2009, 5:07:34 PM12/27/09
to subtext
Hi all,
unfortunately my wife Daniela has to work a few hrs a day while we are on holiday, so I'll bring my laptop in the mountains as well.
I was mainly thinking about writing some blog posts, explaining the way Lucene.net has been implemented into subtext and get ready a post for that explains the new feature in subtext.
And I'll make sure the new features (related posts and more results) are nice looking in all the default skins.
Simo

Phil Haack

unread,
Dec 27, 2009, 5:11:07 PM12/27/09
to <subtext@googlegroups.com>, subtext
I fixed up more search results :) but do take a look.

I did run into one exception yesterday. Something about a File lock on the AppData directory. I didn't save the stack trace unfortunately. Restarting AppDomain fixed it.

Phil

Sent from my mobile phone

Simone Chiaretta

unread,
Dec 27, 2009, 5:18:30 PM12/27/09
to subtext
Yeah, I know
that happens quite often when you stop debugging: it doesn't trigger the Dispose method and leave the Lucene index in a locked state.
But if you stop the vs webserver correctly it works. Not sure if it's something we have to worry about or not.
Otherwise an "unlock" button might do the trick
Simo

Simone Chiaretta

unread,
Dec 27, 2009, 5:42:24 PM12/27/09
to sub...@googlegroups.com
Besides that problem, were you able to index your blog?

Phil Haack

unread,
Dec 27, 2009, 7:22:59 PM12/27/09
to <subtext@googlegroups.com>, subtext
Oh good. Should we have a finalizer to be on the safe side?


Sent from my mobile phone

Phil Haack

unread,
Dec 27, 2009, 7:24:36 PM12/27/09
to <subtext@googlegroups.com>, sub...@googlegroups.com
Yes, works great!

On the search results page, I'd like to show a bit more info than just
the title. Perhaps date published, excerpt, and maybe categories etc.

Can we do that?

Phil

Sent from my mobile phone

On Dec 27, 2009, at 2:43 PM, "Simone Chiaretta" <simone.c...@gmail.com

Simone Chiaretta

unread,
Dec 28, 2009, 4:05:37 AM12/28/09
to sub...@googlegroups.com
The date published is already on the page.
For the excerpt... The naive approach is taking the first 100 words. A
better but more complicate one will be taking also into account ends
of paragraphs and similar things.
Do we already have something that builds it?

The cats, not sure if it adds a lot of value, but adding them at
indexing time is not a big deal

simo

--

Stéphane Erbrech

unread,
Dec 28, 2009, 3:23:19 PM12/28/09
to sub...@googlegroups.com
You could also highlight the word you were searching for and cut an extract of 15 words before and 15 words after.
We do that with article in our news search engine at work. that gives you an extract that puts you in the context of the matched word.
pretty useful and still compact :)

Best Regards,
Cordialement,

Stéphane Erbrech

Simone Chiaretta

unread,
Dec 28, 2009, 4:51:16 PM12/28/09
to sub...@googlegroups.com
Yeah, I was thinking about that as well, but how do you deal with
situations where a word is found many times in a post, or when you
search for multiple words?
There is an highlighter module for lucene, I'll have a look at it
simo

On Monday, December 28, 2009, Stéphane Erbrech
<stephane...@gmail.com> wrote:
> You could also highlight the word you were searching for and cut an extract of 15 words before and 15 words after.We do that with article in our news search engine at work. that gives you an extract that puts you in the context of the matched word.
>
> pretty useful and still compact :)Best Regards,


> Cordialement,
>
> Stéphane Erbrech
>
>
> On Mon, Dec 28, 2009 at 10:05 AM, Simone Chiaretta <simone.c...@gmail.com> wrote:
>
>
> or the excerpt... The naive approach is taking the first 100 words. A
> better but more complicate one will be taking also into account ends
> of paragraphs and similar things.
> Do we already have something that builds it?
>
> The cats, not sure if it adds a lot of value, but adding them at
> indexing time is not a big deal
>
>

> --
>
> You received this message because you are subscribed to the Google Groups "Subtext" group.
> To post to this group, send email to sub...@googlegroups.com.
> To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/subtext?hl=en.
>

--

Phil Haack

unread,
Dec 28, 2009, 6:14:37 PM12/28/09
to sub...@googlegroups.com
I'd just do the first occurrence in that case.

-----Original Message-----
From: sub...@googlegroups.com [mailto:sub...@googlegroups.com] On Behalf Of Simone Chiaretta
Sent: Monday, December 28, 2009 1:51 PM
To: sub...@googlegroups.com
Subject: Re: [subtext] Some changes to more search results...

Stéphane Erbrech

unread,
Dec 29, 2009, 5:08:28 PM12/29/09
to sub...@googlegroups.com
Yes, you can still have a List of extract, and treat it the way you want display only the first, or display more... that's details :)

Best Regards,
Cordialement,

Stéphane Erbrech


Simone Chiaretta

unread,
Jan 3, 2010, 11:39:56 AM1/3/10
to subtext
Hi all,
back from holidays :)
was testing the fake referrer feature, but typing
http://localhost:2732/archive/2009/12/11/asp.net-mvc-controllerfactory-for-unity-and-the-reasoning-behind-it.aspx?referrer=http://google.com?q=test

redirects to the homepage
if I don't write http:// in the referrer the feature is not triggered

Simone

--

You received this message because you are subscribed to the Google Groups "Subtext" group.
To post to this group, send email to sub...@googlegroups.com.
To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/subtext?hl=en.

Phil Haack

unread,
Jan 3, 2010, 1:14:06 PM1/3/10
to <subtext@googlegroups.com>, subtext
Yeah, the "http://" is required. That's how it should be, right?


Sent from my mobile phone

Simone Chiaretta

unread,
Jan 3, 2010, 7:22:23 PM1/3/10
to sub...@googlegroups.com
But if I type http:// the browser redirects me to the homepage, not to the post page.
Does it work for you?

Phil Haack

unread,
Jan 4, 2010, 12:39:54 AM1/4/10
to sub...@googlegroups.com

Well it can’t just be http:// it needs to be a full URL.

 

http://localhost:2732/ archive/2009/11/19/aspnetmvc2-custom-validation.aspx?referrer=http://google.com/?q=test

 

This works for me.


Phil

 

 

From: sub...@googlegroups.com [mailto:sub...@googlegroups.com] On Behalf Of Simone Chiaretta
Sent: Sunday, January 03, 2010 4:22 PM
To: sub...@googlegroups.com
Subject: Re: [subtext] Some changes to more search results...

 

But if I type http:// the browser redirects me to the homepage, not to the post page.

Simone Chiaretta

unread,
Jan 5, 2010, 4:57:16 AM1/5/10
to subtext
Yeah.. sure... the full url

http://localhost:2732/archive/2009/12/24/merry-christmas-and-happy-new-year-from-codeclimber.aspx?referrer=http://www.google.com/?q=test

still doesn't work for me... get redirected to the homepage... but nevermind
Simo

Phil Haack

unread,
Jan 5, 2010, 11:17:23 AM1/5/10
to sub...@googlegroups.com

Weird. Try stepping through it.

Simone Chiaretta

unread,
Jan 5, 2010, 11:49:59 AM1/5/10
to subtext
It seems like it's a problem of the browser...
the first request that hits the apps after I type the url is for the default.aspx

Simo

Simone Chiaretta

unread,
Jan 7, 2010, 6:11:15 PM1/7/10
to subtext
Other then the optimization I'm doing following the suggestions of one of the developers of Lucene.net, what is that we need to add to the search engine before the release?
I see these following possible tasks:

1 - add an excerpt of the document retrieved in the search result (a-la Google, with the text surrounding the first instance of the word)
2 - add search to the aggregate blog
2.1 - add a search page for the whole installation
2.2 - add an opensearch manifest also for the aggreagate blog
2.3 - add some kind of utility page in the host admin

3 - something else I am missing?

Which one do you think are needed for this release?

Simone

Phil Haack

unread,
Jan 7, 2010, 7:39:32 PM1/7/10
to sub...@googlegroups.com

I really want to lock down this release. I think we can do a quick point release afterwards that includes search for the aggregate blog.

 

We recently had a flurry of new bugs opened by Bill Graziano who is testing the aggregate blog so I’d want to focus on fixing those first.

 

Unfortunately I’m going to be crazy busy. We have this annoyance coming up with all these so called “MVP”s coming into town and I have to dance like a monkey for them. ;)

Simone Chiaretta

unread,
Jan 8, 2010, 3:05:34 AM1/8/10
to sub...@googlegroups.com
Those annoying MVPs :)
So, no more new features, just bug fixing and stabilization: so for
the moment the search result page is ok that way, correct?

I've asked the ugidotnet team to help testing the indexing/searching
with their big db, hope it works fine with 50k blog posts as well :)

they asked a little favour as "payback": that we focus our next
release on making the host admin usable for installation with more
than 10 blogs :)

simo

--

Simon Philp

unread,
Jan 8, 2010, 9:23:23 AM1/8/10
to Subtext
Guys,
I am trying to trigger this locally and it's just redirecting me to
the homepage.

I have tried ?referrer=http://google.com?q=subtext skins

result diverted to homepage.

Anyone else having this happen locally?

Si

Simone Chiaretta

unread,
Jan 8, 2010, 9:25:35 AM1/8/10
to subtext
Yeah, same happens to me... only Phil is seeing it working correctly :)

--
You received this message because you are subscribed to the Google Groups "Subtext" group.
To post to this group, send email to sub...@googlegroups.com.
To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/subtext?hl=en.



Phil Haack

unread,
Jan 8, 2010, 11:31:42 AM1/8/10
to sub...@googlegroups.com

Can you step through the code and let me know what’s causing the redirect?

 

From: sub...@googlegroups.com [mailto:sub...@googlegroups.com] On Behalf Of Simone Chiaretta


Sent: Friday, January 08, 2010 6:26 AM
To: subtext

Simone Chiaretta

unread,
Jan 8, 2010, 11:35:03 AM1/8/10
to subtext
Can u remind me which is the first entrance point of the app?
Simo

Phil Haack

unread,
Jan 8, 2010, 11:37:34 AM1/8/10
to sub...@googlegroups.com

BlogRequestModule is probably the best place to start. Or Application_BeginRequest.


Phil

Phil Haack

unread,
Jan 8, 2010, 11:38:30 AM1/8/10
to sub...@googlegroups.com
Yeah, would love to help them out. The HostAdmin is a relatively small interface. That'd be a great one to re-implement using MVC Views.

Phil

Simone Chiaretta

unread,
Jan 8, 2010, 12:12:42 PM1/8/10
to subtext
Yeah.. that could be done :)
I'll meet with him after we release 2.5: he has many requests for the HostAdmin :)

--
You received this message because you are subscribed to the Google Groups "Subtext" group.
To post to this group, send email to sub...@googlegroups.com.
To unsubscribe from this group, send email to subtext+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/subtext?hl=en.



Simone Chiaretta

unread,
Jan 10, 2010, 3:47:38 PM1/10/10
to sub...@googlegroups.com
Using this url:

The error happens in this method:
GetFileNotFoundRedirectUrl

it seems like it regognizes the URL in the referrer query parameters as an indicator of a redirect from a page not found.

Simone

Simone Chiaretta

unread,
Jan 10, 2010, 4:34:04 PM1/10/10
to sub...@googlegroups.com
I checked in a possible fix to the problem.
IMHO the bug is that RightAfter should not return the original string if the separator is not found, but seems like this is a "feature" of the method as this is also explained in the comment in the method.
Simo

Phil Haack

unread,
Jan 10, 2010, 4:36:29 PM1/10/10
to sub...@googlegroups.com

I agree. RightAfter should return an empty string if the separator is not found. However, we need to be careful if we change it to make sure that any methods already using it don’t rely on the current behavior.

Simone Chiaretta

unread,
Jan 10, 2010, 4:41:16 PM1/10/10
to sub...@googlegroups.com
Well.. for the moment I just return null if the name of the query parameter is referrer (the redirect url is usually in format of 404;http://www.example.com)
We'll come to this problem in the next release :)
Simo

Phil Haack

unread,
Jan 10, 2010, 4:49:32 PM1/10/10
to sub...@googlegroups.com

Sounds good. Yeah, let’s make the safest change for now and log a bug for a future release. J

Reply all
Reply to author
Forward
0 new messages