My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="guestbook.GuestBookEntry" %>
<%@ page import="guestbook.PMF" %>


<%@page import="guestbook.SearchJanitor"%><html>
<head>
<title>Searchable Guestbook Example</title>
</head>

<body>

<form action="/search.jsp" method="get">
<div><input name="search"></input></div>
<div><input type="submit" value="Search" /></div>
</form>

<%
String searchString = request.getParameter("search");


if (searchString != null) {

out.println("Results for:<b> " + searchString + "</b>");
PersistenceManager pm = PMF.get().getPersistenceManager();


List<GuestBookEntry> searchResults = SearchJanitor.searchGuestBookEntries(searchString, pm);


if (searchResults.isEmpty()) {
%>
<p>No results found. Please try different search.</p>
<%
} else {
for (GuestBookEntry g : searchResults) {

%>
<blockquote><%= g.getContent() %></blockquote>
<%
}
}
pm.close();
}

%>


<a href="guestbook.jsp">Back to main page</a>

<p>
Example project <a href="http://code.google.com/p/guestbook-example-appengine-full-text-search/">guestbook-example-appengine-full-text-search</a>.
</p>

</body>
</html>

Change log

r23 by raphael.andre.bauer on Apr 7, 2010   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

r3 by raphael.andre.bauer on Apr 7, 2010   Diff
initial checkin
All revisions of this file

File info

Size: 1572 bytes, 61 lines

File properties

svn:mime-type
text/plain
Powered by Google Project Hosting